summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_getlimits.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests/test_getlimits.py')
-rw-r--r--numpy/lib/tests/test_getlimits.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_getlimits.py b/numpy/lib/tests/test_getlimits.py
new file mode 100644
index 000000000..99a6f5160
--- /dev/null
+++ b/numpy/lib/tests/test_getlimits.py
@@ -0,0 +1,38 @@
+""" Test functions for limits module.
+"""
+
+from scipy.testing import *
+set_package_path()
+import scipy.base;reload(scipy.base)
+from scipy.base.getlimits import finfo
+from scipy import single,double,longdouble
+restore_path()
+
+##################################################
+
+class test_python_float(ScipyTestCase):
+ def check_singleton(self):
+ ftype = finfo(float)
+ ftype2 = finfo(float)
+ assert_equal(id(ftype),id(ftype2))
+
+class test_single(ScipyTestCase):
+ def check_singleton(self):
+ ftype = finfo(single)
+ ftype2 = finfo(single)
+ assert_equal(id(ftype),id(ftype2))
+
+class test_double(ScipyTestCase):
+ def check_singleton(self):
+ ftype = finfo(double)
+ ftype2 = finfo(double)
+ assert_equal(id(ftype),id(ftype2))
+
+class test_longdouble(ScipyTestCase):
+ def check_singleton(self,level=2):
+ ftype = finfo(longdouble)
+ ftype2 = finfo(longdouble)
+ assert_equal(id(ftype),id(ftype2))
+
+if __name__ == "__main__":
+ ScipyTest().run()