Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 503356e

Browse files
authored
fix: make tests slightly error tolerant (#4)
uses the assert_almost_equal function instead of assert_array_equal
1 parent 6d03ed8 commit 503356e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/tests/test_ticker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def test_tick_values_correct(self):
246246
1.e+03, 2.e+03, 5.e+03, 1.e+04, 2.e+04, 5.e+04,
247247
1.e+05, 2.e+05, 5.e+05, 1.e+06, 2.e+06, 5.e+06,
248248
1.e+07, 2.e+07, 5.e+07, 1.e+08, 2.e+08, 5.e+08])
249-
assert_array_equal(ll.tick_values(1, 1e7), test_value)
249+
assert_almost_equal(ll.tick_values(1, 1e7), test_value)
250250

251251
def test_tick_values_not_empty(self):
252252
mpl.rcParams['_internal.classic_mode'] = False
@@ -257,7 +257,7 @@ def test_tick_values_not_empty(self):
257257
1.e+05, 2.e+05, 5.e+05, 1.e+06, 2.e+06, 5.e+06,
258258
1.e+07, 2.e+07, 5.e+07, 1.e+08, 2.e+08, 5.e+08,
259259
1.e+09, 2.e+09, 5.e+09])
260-
assert_array_equal(ll.tick_values(1, 1e8), test_value)
260+
assert_almost_equal(ll.tick_values(1, 1e8), test_value)
261261

262262

263263
class TestNullLocator:

0 commit comments

Comments
 (0)