diff options
author | FranchuFranchu <fff999abc999@gmail.com> | 2020-03-19 18:40:03 -0300 |
---|---|---|
committer | FranchuFranchu <fff999abc999@gmail.com> | 2020-03-21 18:16:44 -0300 |
commit | 18d2a218ba338b49467a64842367061eb53e829a (patch) | |
tree | 4c8090e0cc77ce8e9e051b682521411848716e72 /pint/testsuite | |
parent | 46f305556c17231e58c320f1b551e7061cfea6d4 (diff) | |
download | pint-18d2a218ba338b49467a64842367061eb53e829a.tar.gz |
Fixed bug with to_compact
Diffstat (limited to 'pint/testsuite')
-rw-r--r-- | pint/testsuite/test_numpy.py | 2 | ||||
-rw-r--r-- | pint/testsuite/test_quantity.py | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/pint/testsuite/test_numpy.py b/pint/testsuite/test_numpy.py index 4e89172..55de9bf 100644 --- a/pint/testsuite/test_numpy.py +++ b/pint/testsuite/test_numpy.py @@ -190,7 +190,7 @@ class TestNumpyArrayManipulation(TestNumpyMethods): for func in (np.concatenate, np.stack, np.hstack, np.vstack, np.dstack): with self.subTest(func=func): self.assertQuantityEqual( - func([self.q] * 2), self.Q_(func([self.q.m] * 2), self.ureg.m), + func([self.q] * 2), self.Q_(func([self.q.m] * 2), self.ureg.m) ) # One or more of the args is a bare array full of zeros or NaNs self.assertQuantityEqual( diff --git a/pint/testsuite/test_quantity.py b/pint/testsuite/test_quantity.py index d4fa778..b58e227 100644 --- a/pint/testsuite/test_quantity.py +++ b/pint/testsuite/test_quantity.py @@ -608,6 +608,12 @@ class TestQuantityToCompact(QuantityTestCase): with self.assertWarns(RuntimeWarning): self.compareQuantity_compact(x, x) + def test_very_large_to_compact(self): + # This should not raise an IndexError + self.compareQuantity_compact( + self.Q_(10000, "yottameter"), self.Q_(10 ** 28, "meter").to_compact() + ) + class TestQuantityBasicMath(QuantityTestCase): |