From 966038e30b21e62ab7729527f3f0bba6e18eb805 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Tue, 5 Apr 2011 21:00:10 -0600 Subject: STY: Replace assert by assert_ in tests. There remain 124 uses of assert in non-testing files that should be checked for correctness. --- numpy/testing/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'numpy/testing/utils.py') 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): -- cgit v1.2.1