diff options
author | Pauli Virtanen <pav@iki.fi> | 2009-10-10 16:12:27 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2009-10-10 16:12:27 +0000 |
commit | 72c9eea9e58f9b57f97a32a3ab9e3ca9b25dd736 (patch) | |
tree | e1fdc2fc15420692a3d02098d3be4fffeaabe21e | |
parent | 8cad335f8b97100df988dbb6fd5d06072c667515 (diff) | |
download | numpy-72c9eea9e58f9b57f97a32a3ab9e3ca9b25dd736.tar.gz |
Don't include assert_valid_refcount in numpy.testing.*
It's a private function used only in two internal regression tests.
-rw-r--r-- | numpy/core/tests/test_regression.py | 3 | ||||
-rw-r--r-- | numpy/lib/tests/test_regression.py | 3 | ||||
-rw-r--r-- | numpy/testing/utils.py | 8 |
3 files changed, 10 insertions, 4 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index 9f763ddbd..f638558d1 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -4,6 +4,7 @@ import sys import gc from os import path from numpy.testing import * +from numpy.testing.utils import _assert_valid_refcount import numpy as np rlevel = 1 @@ -487,7 +488,7 @@ class TestRegression(TestCase): def test_refcount_vdot(self, level=rlevel): """Changeset #3443""" - assert_valid_refcount(np.vdot) + _assert_valid_refcount(np.vdot) def test_startswith(self, level=rlevel): ca = np.char.array(['Hi','There']) diff --git a/numpy/lib/tests/test_regression.py b/numpy/lib/tests/test_regression.py index 3786d735d..9821ba97e 100644 --- a/numpy/lib/tests/test_regression.py +++ b/numpy/lib/tests/test_regression.py @@ -1,4 +1,5 @@ from numpy.testing import * +from numpy.testing.utils import _assert_valid_refcount import numpy as np rlevel = 1 @@ -42,7 +43,7 @@ class TestRegression(TestCase): """Ticket #378""" def p(x,y): return 123 v = np.vectorize(p) - assert_valid_refcount(v) + _assert_valid_refcount(v) def test_poly1d_nan_roots(self, level=rlevel): """Ticket #396""" diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 71b5944b6..e5e86250f 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -14,7 +14,7 @@ __all__ = ['assert_equal', 'assert_almost_equal','assert_approx_equal', 'assert_array_almost_equal', 'assert_raises', 'build_err_msg', 'decorate_methods', 'jiffies', 'memusage', 'print_assert_equal', 'raises', 'rand', 'rundocs', 'runstring', 'verbose', 'measure', - 'assert_', 'assert_valid_refcount'] + 'assert_'] verbose = 0 @@ -1064,7 +1064,11 @@ def measure(code_str,times=1,label=None): elapsed = jiffies() - elapsed return 0.01*elapsed -def assert_valid_refcount(op): +def _assert_valid_refcount(op): + """ + Check that ufuncs don't mishandle refcount of object `1`. + Used in a few regression tests. + """ import numpy as np a = np.arange(100 * 100) b = np.arange(100*100).reshape(100, 100) |