codekingpro/portable-devtools
114k
1import numpy as np
2import numpy.typing as npt
3
4AR_U: npt.NDArray[np.str_]
5
6def func(x: object) -> bool: ...
7
8np.testing.assert_(True, msg=1) # type: ignore[arg-type]
9np.testing.build_err_msg(1, "test") # type: ignore[arg-type]
10np.testing.assert_almost_equal(AR_U, AR_U) # type: ignore[arg-type]
11np.testing.assert_approx_equal([1, 2, 3], [1, 2, 3]) # type: ignore[arg-type]
12np.testing.assert_array_almost_equal(AR_U, AR_U) # type: ignore[arg-type]
13np.testing.assert_array_less(AR_U, AR_U) # type: ignore[arg-type]
14np.testing.assert_string_equal(b"a", b"a") # type: ignore[arg-type]
15
16np.testing.assert_raises(expected_exception=TypeError, callable=func) # type: ignore[call-overload]
17np.testing.assert_raises_regex(expected_exception=TypeError, expected_regex="T", callable=func) # type: ignore[call-overload]
18
19np.testing.assert_allclose(AR_U, AR_U) # type: ignore[arg-type]
20np.testing.assert_array_almost_equal_nulp(AR_U, AR_U) # type: ignore[arg-type]
21np.testing.assert_array_max_ulp(AR_U, AR_U) # type: ignore[arg-type]
22
23np.testing.assert_warns(RuntimeWarning, func) # type: ignore[call-overload]
24np.testing.assert_no_warnings(func=func) # type: ignore[call-overload]
25np.testing.assert_no_warnings(func) # type: ignore[call-overload]
26np.testing.assert_no_warnings(func, y=None) # type: ignore[call-overload]
27
28np.testing.assert_no_gc_cycles(func=func) # type: ignore[call-overload]
29 