testing.pyi 1.3 KB

12345678910111213141516171819202122232425262728
  1. import numpy as np
  2. import numpy.typing as npt
  3. AR_U: npt.NDArray[np.str_]
  4. def func() -> bool: ...
  5. np.testing.assert_(True, msg=1) # E: incompatible type
  6. np.testing.build_err_msg(1, "test") # E: incompatible type
  7. np.testing.assert_almost_equal(AR_U, AR_U) # E: incompatible type
  8. np.testing.assert_approx_equal([1, 2, 3], [1, 2, 3]) # E: incompatible type
  9. np.testing.assert_array_almost_equal(AR_U, AR_U) # E: incompatible type
  10. np.testing.assert_array_less(AR_U, AR_U) # E: incompatible type
  11. np.testing.assert_string_equal(b"a", b"a") # E: incompatible type
  12. np.testing.assert_raises(expected_exception=TypeError, callable=func) # E: No overload variant
  13. np.testing.assert_raises_regex(expected_exception=TypeError, expected_regex="T", callable=func) # E: No overload variant
  14. np.testing.assert_allclose(AR_U, AR_U) # E: incompatible type
  15. np.testing.assert_array_almost_equal_nulp(AR_U, AR_U) # E: incompatible type
  16. np.testing.assert_array_max_ulp(AR_U, AR_U) # E: incompatible type
  17. np.testing.assert_warns(warning_class=RuntimeWarning, func=func) # E: No overload variant
  18. np.testing.assert_no_warnings(func=func) # E: No overload variant
  19. np.testing.assert_no_warnings(func, None) # E: Too many arguments
  20. np.testing.assert_no_warnings(func, test=None) # E: Unexpected keyword argument
  21. np.testing.assert_no_gc_cycles(func=func) # E: No overload variant