diff options
author | gfyoung <gfyoung@mit.edu> | 2016-01-25 18:37:23 +0000 |
---|---|---|
committer | gfyoung <gfyoung@mit.edu> | 2016-01-25 19:20:35 +0000 |
commit | d3d2f8e92cd08bb64cc520cf714bc70fb31909ce (patch) | |
tree | 9c3e323ce5e62a8dfb04f4a0b163552d5a757d52 | |
parent | e0acd3fea475429070ff5682225b00aa8f3dbbcf (diff) | |
download | numpy-d3d2f8e92cd08bb64cc520cf714bc70fb31909ce.tar.gz |
TST: Fixed f2py test for win32 virtualenv
Fixed test_scripts.test_f2py test so that
it can pass correctly on win32 virtualenvs,
in which the Python executable and the
f2py.py file are both in the Scripts
directory.
-rw-r--r-- | numpy/tests/test_scripts.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/tests/test_scripts.py b/numpy/tests/test_scripts.py index 94587e807..2aed75eba 100644 --- a/numpy/tests/test_scripts.py +++ b/numpy/tests/test_scripts.py @@ -62,7 +62,13 @@ def run_command(cmd, check_code=True): def test_f2py(): # test that we can run f2py script if sys.platform == 'win32': - f2py_cmd = r"%s\Scripts\f2py.py" % dirname(sys.executable) + exe_dir = dirname(sys.executable) + + if exe_dir.endswith('Scripts'): # virtualenv + f2py_cmd = r"%s\f2py.py" % exe_dir + else: + f2py_cmd = r"%s\Scripts\f2py.py" % exe_dir + code, stdout, stderr = run_command([sys.executable, f2py_cmd, '-v']) success = stdout.strip() == asbytes('2') assert_(success, "Warning: f2py not found in path") |