diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-12-26 15:58:07 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-12-26 16:04:12 -0700 |
commit | e89d9bb2e16c1746ce234b81aff4731277b31ddd (patch) | |
tree | 40a949ef4840c097dbd20310ccf28c530ce24306 /numpy/tests/test_scripts.py | |
parent | 555787a5b6a0ec4e27ce05a2c96d97b2aa48cef7 (diff) | |
download | numpy-e89d9bb2e16c1746ce234b81aff4731277b31ddd.tar.gz |
BUG: ignore exceptions in numpy/tests/test_scripts.py/test_f2p
The test was checking whether the f2py script was installed as either of
two names, but was only catching OSError, so the second check was
skipped if the first failed for another reason. The caused the
runtests.py script to fail it does not install the script as f2py but
rather with the python version appended.
Diffstat (limited to 'numpy/tests/test_scripts.py')
-rw-r--r-- | numpy/tests/test_scripts.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/tests/test_scripts.py b/numpy/tests/test_scripts.py index 74efd2650..94587e807 100644 --- a/numpy/tests/test_scripts.py +++ b/numpy/tests/test_scripts.py @@ -14,7 +14,7 @@ from nose.tools import assert_equal from numpy.testing.decorators import skipif from numpy.testing import assert_ -skipif_inplace = skipif(isfile(pathjoin(dirname(np.__file__), '..', 'setup.py'))) +is_inplace = isfile(pathjoin(dirname(np.__file__), '..', 'setup.py')) def run_command(cmd, check_code=True): """ Run command sequence `cmd` returning exit code, stdout, stderr @@ -58,7 +58,7 @@ def run_command(cmd, check_code=True): return proc.returncode, stdout, stderr -@skipif_inplace +@skipif(is_inplace) def test_f2py(): # test that we can run f2py script if sys.platform == 'win32': @@ -77,6 +77,7 @@ def test_f2py(): assert_equal(stdout.strip(), asbytes('2')) success = True break - except OSError: + except: pass - assert_(success, "Warning: neither %s nor %s found in path" % f2py_cmds) + msg = "Warning: neither %s nor %s found in path" % f2py_cmds + assert_(success, msg) |