diff options
| author | Jörn Hees <joernhees@users.noreply.github.com> | 2015-12-02 16:48:36 +0100 |
|---|---|---|
| committer | Joern Hees <dev@joernhees.de> | 2015-12-05 19:08:10 +0100 |
| commit | e3243e2110842132ec3ebfe1d9f7857ec58ffd34 (patch) | |
| tree | 0465990d44e4d52a62938f496ec59fbc82747d2e /numpy/tests/test_scripts.py | |
| parent | 45ff55634c0ddd44bd07141b3ffb6c4c5f08118c (diff) | |
| download | numpy-e3243e2110842132ec3ebfe1d9f7857ec58ffd34.tar.gz | |
TST: test f2py, fallback on f2py2.7 etc., fixes #6718
Diffstat (limited to 'numpy/tests/test_scripts.py')
| -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]) |
