|
12 | 12 | from numpy.compat.py3k import basestring, asbytes
|
13 | 13 | from nose.tools import assert_equal
|
14 | 14 | from numpy.testing.decorators import skipif
|
| 15 | +from numpy.testing import assert_ |
15 | 16 |
|
16 | 17 | skipif_inplace = skipif(isfile(pathjoin(dirname(np.__file__), '..', 'setup.py')))
|
17 | 18 |
|
@@ -63,7 +64,18 @@ def test_f2py():
|
63 | 64 | if sys.platform == 'win32':
|
64 | 65 | f2py_cmd = r"%s\Scripts\f2py.py" % dirname(sys.executable)
|
65 | 66 | code, stdout, stderr = run_command([sys.executable, f2py_cmd, '-v'])
|
| 67 | + assert_equal(stdout.strip(), asbytes('2')) |
66 | 68 | else:
|
67 |
| - f2py_cmd = 'f2py' + basename(sys.executable)[6:] |
68 |
| - code, stdout, stderr = run_command([f2py_cmd, '-v']) |
69 |
| - assert_equal(stdout.strip(), asbytes('2')) |
| 69 | + # unclear what f2py cmd was installed as, check plain (f2py) and |
| 70 | + # current python version specific one (f2py3.4) |
| 71 | + f2py_cmds = ['f2py', 'f2py' + basename(sys.executable)[6:]] |
| 72 | + success = False |
| 73 | + for f2py_cmd in f2py_cmds: |
| 74 | + try: |
| 75 | + code, stdout, stderr = run_command([f2py_cmd, '-v']) |
| 76 | + assert_equal(stdout.strip(), asbytes('2')) |
| 77 | + success = True |
| 78 | + break |
| 79 | + except FileNotFoundError: |
| 80 | + pass |
| 81 | + assert_(success, "wasn't able to find f2py or %s on commandline" % f2py_cmds[1]) |
0 commit comments