diff options
Diffstat (limited to 'numpy/testing')
-rw-r--r-- | numpy/testing/noseclasses.py | 15 | ||||
-rw-r--r-- | numpy/testing/utils.py | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/numpy/testing/noseclasses.py b/numpy/testing/noseclasses.py index 05d244083..aae7c5da4 100644 --- a/numpy/testing/noseclasses.py +++ b/numpy/testing/noseclasses.py @@ -148,6 +148,21 @@ class NumpyOutputChecker(doctest.OutputChecker): if not ret: if "#random" in want: return True + + # it would be useful to normalize endianness so that + # bigendian machines don't fail all the tests (and there are + # actually some bigendian examples in the doctests). Let's try + # making them all little endian + got = got.replace("'>","'<") + want= want.replace("'>","'<") + + # try to normalize out 32 and 64 bit default int sizes + for sz in [4,8]: + got = got.replace("'<i%d'"%sz,"int") + want= want.replace("'<i%d'"%sz,"int") + + ret = doctest.OutputChecker.check_output(self, want, + got, optionflags) return ret diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 87ca389f7..abb2956a1 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -381,6 +381,7 @@ def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True): Examples -------- + >>> import numpy.testing as npt >>> npt.assert_almost_equal(2.3333333333333, 2.33333334) >>> npt.assert_almost_equal(2.3333333333333, 2.33333334, decimal=10) ... |