8000
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 57e762f commit c31783eCopy full SHA for c31783e
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