diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-12-05 12:56:20 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-12-05 12:56:20 -0700 |
commit | a42cb551c5da01072a9dd4b980d6a68620672a4e (patch) | |
tree | 2c7942bdb07a3b139153253ce14ecb09263a7be9 | |
parent | 3cc797e5107d5f3fe812b0ccdc9bc96f107f0b20 (diff) | |
parent | e3243e2110842132ec3ebfe1d9f7857ec58ffd34 (diff) | |
download | numpy-a42cb551c5da01072a9dd4b980d6a68620672a4e.tar.gz |
Merge pull request #6756 from joernhees/patch-1
TST: only test f2py, not f2py2.7 etc, fixes #6718
-rw-r--r-- | numpy/tests/test_scripts.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/numpy/tests/test_scripts.py b/numpy/tests/test_scripts.py index c7bb125b3..552383d77 100644 --- a/numpy/tests/test_scripts.py +++ b/numpy/tests/test_scripts.py @@ -12,6 +12,7 @@ import numpy as np from numpy.compat.py3k import basestring, asbytes 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'))) @@ -63,7 +64,18 @@ def test_f2py(): if sys.platform == 'win32': f2py_cmd = r"%s\Scripts\f2py.py" % dirname(sys.executable) code, stdout, stderr = run_command([sys.executable, f2py_cmd, '-v']) + assert_equal(stdout.strip(), asbytes('2')) else: - f2py_cmd = 'f2py' + basename(sys.executable)[6:] - code, stdout, stderr = run_command([f2py_cmd, '-v']) - assert_equal(stdout.strip(), asbytes('2')) + # unclear what f2py cmd was installed as, check plain (f2py) and + # current python version specific one (f2py3.4) + f2py_cmds = ['f2py', 'f2py' + basename(sys.executable)[6:]] + success = False + for f2py_cmd in f2py_cmds: + try: + code, stdout, stderr = run_command([f2py_cmd, '-v']) + assert_equal(stdout.strip(), asbytes('2')) + success = True + break + except FileNotFoundError: + pass + assert_(success, "wasn't able to find f2py or %s on commandline" % f2py_cmds[1]) |