From b26c675e2a91e1042f8f8d634763942c87fbbb6e Mon Sep 17 00:00:00 2001 From: "Nathaniel J. Smith" Date: Thu, 12 Jul 2012 13:20:20 +0100 Subject: [FIX] Make np.random.shuffle less brain-dead The logic in np.random.shuffle was... not very sensible. Fixes trac ticket #2074. This patch also exposes a completely unrelated issue in numpy.testing. Filed as Github issue #347 and marked as knownfail for now. --- numpy/testing/tests/test_utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'numpy/testing/tests') diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py index 067782dc0..bff8b50ab 100644 --- a/numpy/testing/tests/test_utils.py +++ b/numpy/testing/tests/test_utils.py @@ -369,11 +369,14 @@ class TestAssertAllclose(unittest.TestCase): class TestArrayAlmostEqualNulp(unittest.TestCase): + @dec.knownfailureif(True, "Github issue #347") def test_simple(self): - dev = np.random.randn(10) - x = np.ones(10) - y = x + dev * np.finfo(np.float64).eps - assert_array_almost_equal_nulp(x, y, nulp=2 * np.max(dev)) + np.random.seed(12345) + for i in xrange(100): + dev = np.random.randn(10) + x = np.ones(10) + y = x + dev * np.finfo(np.float64).eps + assert_array_almost_equal_nulp(x, y, nulp=2 * np.max(dev)) def test_simple2(self): x = np.random.randn(10) -- cgit v1.2.1