diff options
Diffstat (limited to 'numpy/testing')
-rw-r--r-- | numpy/testing/nosetester.py | 8 | ||||
-rw-r--r-- | numpy/testing/utils.py | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py index 26118eda2..90e09f880 100644 --- a/numpy/testing/nosetester.py +++ b/numpy/testing/nosetester.py @@ -74,7 +74,8 @@ def run_module_suite(file_to_run = None): if file_to_run is None: f = sys._getframe(1) file_to_run = f.f_locals.get('__file__', None) - assert file_to_run is not None + if file_to_run is None: + raise AssertionError import_nose().run(argv=['',file_to_run]) @@ -149,7 +150,8 @@ class NoseTester(object): if package is None: f = sys._getframe(1) package_path = f.f_locals.get('__file__', None) - assert package_path is not None + if package_path is None: + raise AssertionError package_path = os.path.dirname(package_path) package_name = f.f_locals.get('__name__', None) elif isinstance(package, type(os)): @@ -202,7 +204,7 @@ class NoseTester(object): print "nose version %d.%d.%d" % nose.__versioninfo__ - def prepare_test_args(self, label='fast', verbose=1, extra_argv=None, + def prepare_test_args(self, label='fast', verbose=1, extra_argv=None, doctests=False, coverage=False): """ Run tests for module using nose. 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): |