From e4f233ecfedd2aafa258db2d3ae27e30604cc020 Mon Sep 17 00:00:00 2001 From: Paul Ivanov Date: Mon, 28 Dec 2009 20:49:52 +0000 Subject: fixed a whole bunch of doctests --- numpy/testing/noseclasses.py | 15 +++++++++++++++ numpy/testing/utils.py | 1 + 2 files changed, 16 insertions(+) (limited to 'numpy/testing') 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("'>> import numpy.testing as npt >>> npt.assert_almost_equal(2.3333333333333, 2.33333334) >>> npt.assert_almost_equal(2.3333333333333, 2.33333334, decimal=10) ... -- cgit v1.2.1