diff options
author | Eric Schles <erschles@microsoft.com> | 2018-09-25 12:41:52 -0400 |
---|---|---|
committer | Eric Schles <erschles@microsoft.com> | 2018-09-25 12:41:52 -0400 |
commit | 583398dc4cdf4acb8614eff20796dc61ba967950 (patch) | |
tree | 971b975eb7cdae0ed611dc71252135c20c089421 /numpy/tests | |
parent | 5f2a5ae02dee34469d27896249f71deaa0c6de24 (diff) | |
download | numpy-583398dc4cdf4acb8614eff20796dc61ba967950.tar.gz |
updating f2py to ensure that at least f2py base exists, and doesn't error out if multiple do not
Diffstat (limited to 'numpy/tests')
-rw-r--r-- | numpy/tests/test_scripts.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/numpy/tests/test_scripts.py b/numpy/tests/test_scripts.py index 26e3ea745..e4f38a758 100644 --- a/numpy/tests/test_scripts.py +++ b/numpy/tests/test_scripts.py @@ -9,6 +9,7 @@ import os import pytest from os.path import join as pathjoin, isfile, dirname, basename from subprocess import Popen, PIPE +import warnings import numpy as np from numpy.compat.py3k import basestring @@ -92,7 +93,14 @@ def test_f2py(): version = sys.version_info major = str(version.major) minor = str(version.minor) + f2py_success = try_f2py_commands(('f2py',)) f2py_cmds = ('f2py', 'f2py' + major, 'f2py' + major + '.' + minor) - success = try_f2py_commands(f2py_cmds) - msg = "Warning: not all of %s, %s, and %s are found in path" % f2py_cmds - assert_(success == 3, msg) + all_success = try_f2py_commands(f2py_cmds) + if all_success == 3: + return + elif f2py_success == 1: + msg = "f2py fails" + warnings.warn(msg) + else: + msg = "No {}, {}, {} found".format(f2py_cmds) + assert_(f2py_success > 0, msg) |