diff options
author | Anne Archibald <archibald@astron.nl> | 2015-08-28 22:14:25 +0200 |
---|---|---|
committer | Anne Archibald <archibald@astron.nl> | 2015-08-28 22:14:25 +0200 |
commit | 88603606aa3f1470c2e692cf546b8027801a2c53 (patch) | |
tree | c59f67f6d1cfcaaeecfb1907f20ca1f5bca15d34 | |
parent | cfef05e74e0b476ad8895e36046b6e39eab05227 (diff) | |
download | numpy-88603606aa3f1470c2e692cf546b8027801a2c53.tar.gz |
TST: check for best-effort parsing in foreign locales
-rw-r--r-- | numpy/core/tests/test_longdouble.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/tests/test_longdouble.py b/numpy/core/tests/test_longdouble.py index 9e90e8bd1..ed205a6ff 100644 --- a/numpy/core/tests/test_longdouble.py +++ b/numpy/core/tests/test_longdouble.py @@ -19,6 +19,7 @@ _o = 1 + np.finfo(np.longdouble).eps string_to_longdouble_inaccurate = (_o != np.longdouble(repr(_o))) del _o + def test_scalar_extraction(): """Confirm that extracting a value doesn't convert to python float""" o = 1 + np.finfo(np.longdouble).eps @@ -80,6 +81,11 @@ def test_fromstring(): err_msg="reading '%s'" % s) +@in_foreign_locale +def test_fromstring_best_effort(): + assert_equal(np.fromstring("1,234", dtype=float, sep=" "), + np.array([1.])) + def test_fromstring_bogus(): assert_equal(np.fromstring("1. 2. 3. flop 4.", dtype=float, sep=" "), np.array([1., 2., 3.])) |