TST: avoid use of deprecated pytest.warns(None)
+import warnings
+
import numpy as np
import pytest
@@ -82,7 +84,7 @@ def test_no_warning_non_affine_slicing():
np.random.seed(0)
data = np.random.random((10, 10, 10))
viewer.add_image(data, scale=[2, 1, 1], translate=[10, 15, 20])
- with pytest.warns(None) as recorded_warnings:
+ with warnings.catch_warnings(record=True) as recorded_warnings:
viewer.layers[0].refresh()
assert len(recorded_warnings) == 0
