diff options
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r-- | numpy/lib/tests/test_getlimits.py | 59 | ||||
-rw-r--r-- | numpy/lib/tests/test_machar.py | 31 |
2 files changed, 0 insertions, 90 deletions
diff --git a/numpy/lib/tests/test_getlimits.py b/numpy/lib/tests/test_getlimits.py deleted file mode 100644 index 325e5a444..000000000 --- a/numpy/lib/tests/test_getlimits.py +++ /dev/null @@ -1,59 +0,0 @@ -""" Test functions for limits module. -""" - -from numpy.testing import * -import numpy.lib -reload(numpy.lib) -from numpy.lib.getlimits import finfo, iinfo -from numpy import single,double,longdouble -import numpy as np - -################################################## - -class TestPythonFloat(TestCase): - def test_singleton(self): - ftype = finfo(float) - ftype2 = finfo(float) - assert_equal(id(ftype),id(ftype2)) - -class TestSingle(TestCase): - def test_singleton(self): - ftype = finfo(single) - ftype2 = finfo(single) - assert_equal(id(ftype),id(ftype2)) - -class TestDouble(TestCase): - def test_singleton(self): - ftype = finfo(double) - ftype2 = finfo(double) - assert_equal(id(ftype),id(ftype2)) - -class TestLongdouble(TestCase): - def test_singleton(self,level=2): - ftype = finfo(longdouble) - ftype2 = finfo(longdouble) - assert_equal(id(ftype),id(ftype2)) - -class TestIinfo(TestCase): - def test_basic(self): - dts = zip(['i1', 'i2', 'i4', 'i8', - 'u1', 'u2', 'u4', 'u8'], - [np.int8, np.int16, np.int32, np.int64, - np.uint8, np.uint16, np.uint32, np.uint64]) - for dt1, dt2 in dts: - assert_equal(iinfo(dt1).min, iinfo(dt2).min) - assert_equal(iinfo(dt1).max, iinfo(dt2).max) - self.assertRaises(ValueError, iinfo, 'f4') - - def test_unsigned_max(self): - types = np.sctypes['uint'] - for T in types: - assert_equal(iinfo(T).max, T(-1)) - - -def test_instances(): - iinfo(10) - finfo(3.0) - -if __name__ == "__main__": - run_module_suite() diff --git a/numpy/lib/tests/test_machar.py b/numpy/lib/tests/test_machar.py deleted file mode 100644 index 64abf7236..000000000 --- a/numpy/lib/tests/test_machar.py +++ /dev/null @@ -1,31 +0,0 @@ -from numpy.testing import * - -from numpy.lib.machar import MachAr -import numpy.core.numerictypes as ntypes -from numpy import seterr, array - -class TestMachAr(TestCase): - def _run_machar_highprec(self): - # Instanciate MachAr instance with high enough precision to cause - # underflow - try: - hiprec = ntypes.float96 - machar = MachAr(lambda v:array([v], hiprec)) - except AttributeError: - "Skipping test: no nyptes.float96 available on this platform." - - def test_underlow(self): - """Regression testing for #759: instanciating MachAr for dtype = - np.float96 raises spurious warning.""" - serrstate = seterr(all='raise') - try: - try: - self._run_machar_highprec() - except FloatingPointError, e: - self.fail("Caught %s exception, should not have been raised." % e) - finally: - seterr(**serrstate) - - -if __name__ == "__main__": - run_module_suite() |