diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2011-04-05 21:00:10 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-04-05 21:02:29 -0600 |
commit | 966038e30b21e62ab7729527f3f0bba6e18eb805 (patch) | |
tree | 084bd7b40be49614b3770657ceaf1b539adbf964 /numpy/testing/utils.py | |
parent | 4cb2eb4df95740661d7f1944451d2c1cb3482bcf (diff) | |
download | numpy-966038e30b21e62ab7729527f3f0bba6e18eb805.tar.gz |
STY: Replace assert by assert_ in tests. There remain 124 uses of
assert in non-testing files that should be checked for correctness.
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r-- | numpy/testing/utils.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index a2d3119c5..423c75527 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -341,9 +341,8 @@ def print_assert_equal(test_string,actual,desired): """ import pprint - try: - assert(actual == desired) - except AssertionError: + + if not (actual == desired): import cStringIO msg = cStringIO.StringIO() msg.write(test_string) @@ -1117,7 +1116,7 @@ def _assert_valid_refcount(op): for j in range(15): d = op(b,c) - assert(sys.getrefcount(i) >= rc) + assert_(sys.getrefcount(i) >= rc) def assert_allclose(actual, desired, rtol=1e-7, atol=0, err_msg='', verbose=True): |