diff options
author | Jules Chéron <43635101+jules-ch@users.noreply.github.com> | 2022-03-26 14:48:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-26 14:48:00 +0100 |
commit | c4ddc27ff1da42335bb396ad22b62c493465a5ff (patch) | |
tree | 63d2679afaf4e4ace8afaade0a0a2e795fd72db0 /pint/testsuite/test_quantity.py | |
parent | 7394cd91c2a1c895fe3f9d456b1b5cd33f4ca129 (diff) | |
parent | ea4cc5b2bb55f85faf10323a525a70238aa6736e (diff) | |
download | pint-c4ddc27ff1da42335bb396ad22b62c493465a5ff.tar.gz |
Merge pull request #1478 from jules-ch/fix-pytests-warnings
Remove most pytest warnings
Diffstat (limited to 'pint/testsuite/test_quantity.py')
-rw-r--r-- | pint/testsuite/test_quantity.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/pint/testsuite/test_quantity.py b/pint/testsuite/test_quantity.py index 17822ec..9836a8c 100644 --- a/pint/testsuite/test_quantity.py +++ b/pint/testsuite/test_quantity.py @@ -1223,8 +1223,8 @@ class TestOffsetUnitMath(QuantityTestCase): (q1v, q1u), (q2v, q2u) = input_tuple # update input tuple with new values to have correct values on failure input_tuple = ( - (np.array([q1v] * 2, dtype=np.float), q1u), - (np.array([q2v] * 2, dtype=np.float), q2u), + (np.array([q1v] * 2, dtype=float), q1u), + (np.array([q2v] * 2, dtype=float), q2u), ) Q_ = self.Q_ qin1, qin2 = input_tuple @@ -1234,7 +1234,7 @@ class TestOffsetUnitMath(QuantityTestCase): with pytest.raises(OffsetUnitCalculusError): op.iadd(q1_cp, q2) else: - expected = np.array([expected[0]] * 2, dtype=np.float), expected[1] + expected = np.array([expected[0]] * 2, dtype=float), expected[1] assert op.iadd(q1_cp, q2).units == Q_(*expected).units q1_cp = copy.copy(q1) helpers.assert_quantity_almost_equal( @@ -1302,8 +1302,8 @@ class TestOffsetUnitMath(QuantityTestCase): (q1v, q1u), (q2v, q2u) = input_tuple # update input tuple with new values to have correct values on failure input_tuple = ( - (np.array([q1v] * 2, dtype=np.float), q1u), - (np.array([q2v] * 2, dtype=np.float), q2u), + (np.array([q1v] * 2, dtype=float), q1u), + (np.array([q2v] * 2, dtype=float), q2u), ) Q_ = self.Q_ qin1, qin2 = input_tuple @@ -1313,7 +1313,7 @@ class TestOffsetUnitMath(QuantityTestCase): with pytest.raises(OffsetUnitCalculusError): op.isub(q1_cp, q2) else: - expected = np.array([expected[0]] * 2, dtype=np.float), expected[1] + expected = np.array([expected[0]] * 2, dtype=float), expected[1] assert op.isub(q1_cp, q2).units == Q_(*expected).units q1_cp = copy.copy(q1) helpers.assert_quantity_almost_equal( @@ -1380,8 +1380,8 @@ class TestOffsetUnitMath(QuantityTestCase): (q1v, q1u), (q2v, q2u) = input_tuple # update input tuple with new values to have correct values on failure input_tuple = ( - (np.array([q1v] * 2, dtype=np.float), q1u), - (np.array([q2v] * 2, dtype=np.float), q2u), + (np.array([q1v] * 2, dtype=float), q1u), + (np.array([q2v] * 2, dtype=float), q2u), ) Q_ = self.Q_ qin1, qin2 = input_tuple @@ -1391,7 +1391,7 @@ class TestOffsetUnitMath(QuantityTestCase): with pytest.raises(OffsetUnitCalculusError): op.imul(q1_cp, q2) else: - expected = np.array([expected[0]] * 2, dtype=np.float), expected[1] + expected = np.array([expected[0]] * 2, dtype=float), expected[1] assert op.imul(q1_cp, q2).units == Q_(*expected).units q1_cp = copy.copy(q1) helpers.assert_quantity_almost_equal( @@ -1460,8 +1460,8 @@ class TestOffsetUnitMath(QuantityTestCase): (q1v, q1u), (q2v, q2u) = input_tuple # update input tuple with new values to have correct values on failure input_tuple = ( - (np.array([q1v] * 2, dtype=np.float), q1u), - (np.array([q2v] * 2, dtype=np.float), q2u), + (np.array([q1v] * 2, dtype=float), q1u), + (np.array([q2v] * 2, dtype=float), q2u), ) Q_ = self.Q_ qin1, qin2 = input_tuple @@ -1471,7 +1471,7 @@ class TestOffsetUnitMath(QuantityTestCase): with pytest.raises(OffsetUnitCalculusError): op.itruediv(q1_cp, q2) else: - expected = np.array([expected[0]] * 2, dtype=np.float), expected[1] + expected = np.array([expected[0]] * 2, dtype=float), expected[1] assert op.itruediv(q1_cp, q2).units == Q_(*expected).units q1_cp = copy.copy(q1) helpers.assert_quantity_almost_equal( @@ -1526,8 +1526,8 @@ class TestOffsetUnitMath(QuantityTestCase): (q1v, q1u), (q2v, q2u) = input_tuple # update input tuple with new values to have correct values on failure input_tuple = ( - (np.array([q1v] * 2, dtype=np.float), q1u), - (np.array([q2v] * 2, dtype=np.float), q2u), + (np.array([q1v] * 2, dtype=float), q1u), + (np.array([q2v] * 2, dtype=float), q2u), ) Q_ = self.Q_ qin1, qin2 = input_tuple @@ -1537,7 +1537,7 @@ class TestOffsetUnitMath(QuantityTestCase): with pytest.raises(OffsetUnitCalculusError): op.imul(q1_cp, q2) else: - expected = np.array([expected[0]] * 2, dtype=np.float), expected[1] + expected = np.array([expected[0]] * 2, dtype=float), expected[1] assert op.imul(q1_cp, q2).units == Q_(*expected).units q1_cp = copy.copy(q1) helpers.assert_quantity_almost_equal( @@ -1666,7 +1666,7 @@ class TestOffsetUnitMath(QuantityTestCase): in1, in2 = input_tuple if type(in1) is tuple and type(in2) is tuple: (q1v, q1u), (q2v, q2u) = in1, in2 - in1 = self.Q_(*(np.array([q1v] * 2, dtype=np.float), q1u)) + in1 = self.Q_(*(np.array([q1v] * 2, dtype=float), q1u)) in2 = self.Q_(q2v, q2u) elif not type(in1) is tuple and type(in2) is tuple: in2 = self.Q_(*in2) @@ -1685,12 +1685,12 @@ class TestOffsetUnitMath(QuantityTestCase): else: if type(expected_copy[i]) is tuple: expected = self.Q_( - np.array([expected_copy[i][0]] * 2, dtype=np.float), + np.array([expected_copy[i][0]] * 2, dtype=float), expected_copy[i][1], ) assert op.ipow(in1_cp, in2).units == expected.units else: - expected = np.array([expected_copy[i]] * 2, dtype=np.float) + expected = np.array([expected_copy[i]] * 2, dtype=float) in1_cp = copy.copy(in1) helpers.assert_quantity_almost_equal(op.ipow(in1_cp, in2), expected) |