Skip to content

Commit e87c463

Browse files
committed
✅ update test for the testing.* deprecation
1 parent a46827d commit e87c463

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/numpy-stubs/@test/static/accept/testing.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AR_i8: _nt.Array[np.int64]
1717
AR_f8: _nt.Array[np.float64]
1818

1919
bool_obj: bool
20-
suppress_obj: np.testing.suppress_warnings
20+
suppress_obj: np.testing.suppress_warnings # pyright: ignore[reportDeprecated]
2121
func: Callable[[], int]
2222

2323
class Test: ...
@@ -46,12 +46,12 @@ with np.testing.clear_and_catch_warnings(True) as c1:
4646
with np.testing.clear_and_catch_warnings() as c2:
4747
assert_type(c2, None)
4848

49-
assert_type(np.testing.suppress_warnings("once"), np.testing.suppress_warnings)
50-
assert_type(np.testing.suppress_warnings()(func), Callable[[], int])
49+
assert_type(np.testing.suppress_warnings("once"), np.testing.suppress_warnings) # pyright: ignore[reportDeprecated]
50+
assert_type(np.testing.suppress_warnings()(func), Callable[[], int]) # pyright: ignore[reportDeprecated]
5151
assert_type(suppress_obj.filter(RuntimeWarning), None)
5252
assert_type(suppress_obj.record(RuntimeWarning), list[warnings.WarningMessage])
5353
with suppress_obj as c3:
54-
assert_type(c3, np.testing.suppress_warnings)
54+
assert_type(c3, np.testing.suppress_warnings) # pyright: ignore[reportDeprecated]
5555

5656
assert_type(np.testing.verbose, int)
5757
assert_type(np.testing.IS_PYPY, bool)
@@ -142,8 +142,8 @@ assert_type(np.testing.assert_array_almost_equal_nulp(AR_i8, AR_f8, nulp=2), Non
142142
assert_type(np.testing.assert_array_max_ulp(AR_i8, AR_f8, maxulp=2), _nt.Array[np.floating])
143143
assert_type(np.testing.assert_array_max_ulp(AR_i8, AR_f8, dtype=np.float32), _nt.Array[np.floating])
144144

145-
assert_type(np.testing.assert_warns(RuntimeWarning), contextlib._GeneratorContextManager[None])
146-
assert_type(np.testing.assert_warns(RuntimeWarning, func3, 5), bool)
145+
assert_type(np.testing.assert_warns(RuntimeWarning), contextlib._GeneratorContextManager[None]) # pyright: ignore[reportDeprecated]
146+
assert_type(np.testing.assert_warns(RuntimeWarning, func3, 5), bool) # pyright: ignore[reportDeprecated]
147147

148148
assert_type(np.testing.assert_no_warnings(), contextlib._GeneratorContextManager[None])
149149
assert_type(np.testing.assert_no_warnings(func3, 5), bool)

0 commit comments

Comments
 (0)