Skip to content

Commit 1fa184b

Browse files
committed
TST: Fix runtime error checking NaN input to format_cursor_data
1 parent c44ae00 commit 1fa184b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/tests/test_image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,8 @@ def test_image_cursor_formatting():
11801180
assert im.format_cursor_data(data) == '[0]'
11811181

11821182
data = np.nan
1183-
assert im.format_cursor_data(data) == '[nan]'
1183+
with np.errstate(invalid='ignore'):
1184+
assert im.format_cursor_data(data) == '[nan]'
11841185

11851186

11861187
@check_figures_equal(extensions=['png', 'pdf', 'svg'])

0 commit comments

Comments
 (0)