We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1dbd55 commit 752c3ffCopy full SHA for 752c3ff
lib/matplotlib/tests/test_ticker.py
@@ -176,7 +176,12 @@ def test_ScalarFormatter_offset_value():
176
formatter = ax.get_xaxis().get_major_formatter()
177
178
def check_offset_for(left, right, offset):
179
- ax.set_xlim(left, right)
+ with warnings.catch_warnings(record=True) as w:
180
+ warnings.filterwarnings('always', 'Attempting to set identical',
181
+ UserWarning)
182
+ ax.set_xlim(left, right)
183
+ assert_equal(len(w), 1 if left == right else 0)
184
+
185
# Update ticks.
186
next(ax.get_xaxis().iter_ticks())
187
assert_equal(formatter.offset, offset)
0 commit comments