From 8ccad121bccd576ecd212efb44109d697024fbf9 Mon Sep 17 00:00:00 2001 From: aekoroglu Date: Mon, 5 Sep 2022 16:42:51 +0300 Subject: [PATCH] deprecated numpy alias Refer: https://github.com/hamcrest/PyHamcrest/pull/218 --- tests/hamcrest_unit_test/number/iscloseto_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/hamcrest_unit_test/number/iscloseto_test.py b/tests/hamcrest_unit_test/number/iscloseto_test.py index f83964fd..b82109c5 100644 --- a/tests/hamcrest_unit_test/number/iscloseto_test.py +++ b/tests/hamcrest_unit_test/number/iscloseto_test.py @@ -64,7 +64,7 @@ def testMatcherSupportsDecimal(self): class IsNumericTest(unittest.TestCase): @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") def test_numpy_numeric_type_int(self): - self.assertTrue(isnumeric(np.int(1)), "Platform integer (normally either int32 or int64)") + self.assertTrue(isnumeric(np.int_(1)), "Platform integer (normally either int32 or int64)") @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") def test_numpy_numeric_type_int8(self): @@ -102,7 +102,7 @@ def test_numpy_numeric_type_uint64(self): @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") def test_numpy_numeric_type_float(self): - self.assertTrue(isnumeric(np.float(1)), "Shorthand for float64.") + self.assertTrue(isnumeric(np.float_(1)), "Shorthand for float64.") @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") def test_numpy_numeric_type_float16(self): @@ -127,7 +127,7 @@ def test_numpy_numeric_type_float64(self): @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") def test_numpy_numeric_type_complex(self): - self.assertTrue(isnumeric(np.complex(1)), "Shorthand for complex128.") + self.assertTrue(isnumeric(np.complex_(1)), "Shorthand for complex128.") @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") def test_numpy_numeric_type_complex64(self):