summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test__iotools.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests/test__iotools.py')
-rw-r--r--numpy/lib/tests/test__iotools.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/numpy/lib/tests/test__iotools.py b/numpy/lib/tests/test__iotools.py
index c16491aee..ed0f4dc63 100644
--- a/numpy/lib/tests/test__iotools.py
+++ b/numpy/lib/tests/test__iotools.py
@@ -179,6 +179,18 @@ class TestStringConverter(TestCase):
conv = StringConverter(lambda s: date(*(time.strptime(s)[:3])))
assert_equal(conv._mapper[-2][0](0), 0j)
assert(hasattr(conv, 'default'))
+ #
+ def test_keep_default(self):
+ "Make sure we don't lose an explicit default"
+ converter = StringConverter(None, missing_values='', default=-999)
+ converter.upgrade('3.14159265')
+ assert_equal(converter.default, -999)
+ assert_equal(converter.type, np.dtype(float))
+ #
+ converter = StringConverter(None, missing_values='', default=0)
+ converter.upgrade('3.14159265')
+ assert_equal(converter.default, 0)
+ assert_equal(converter.type, np.dtype(float))
#-------------------------------------------------------------------------------