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

Skip to content

Commit f6cdf99

Browse files
Simplify remaining test assertions per review feedback
Use assert_array_equal directly for the fractional offset and base > 1 test cases, matching the style of the first test case.
1 parent bd6f097 commit f6cdf99

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

lib/matplotlib/tests/test_ticker.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -614,15 +614,11 @@ def test_tick_values_not_exceeding_vmax(self):
614614

615615
# Test case with fractional offset
616616
index = mticker.IndexLocator(base=1, offset=0.5)
617-
ticks = index.tick_values(0, 4)
618-
assert all(t <= 4 for t in ticks)
619-
np.testing.assert_array_equal(ticks, [0.5, 1.5, 2.5, 3.5])
617+
assert_array_equal(index.tick_values(0, 4), [0.5, 1.5, 2.5, 3.5])
620618

621619
# Test case with base > 1
622620
index = mticker.IndexLocator(base=2, offset=0)
623-
ticks = index.tick_values(0, 5)
624-
assert all(t <= 5 for t in ticks)
625-
np.testing.assert_array_equal(ticks, [0, 2, 4])
621+
assert_array_equal(index.tick_values(0, 5), [0, 2, 4])
626622

627623

628624
class TestSymmetricalLogLocator:

0 commit comments

Comments
 (0)