Skip to content

Commit

Permalink
TST: Fixed f2py test for win32 virtualenv
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gfyoung committed Jan 25, 2016
1 parent e0acd3f commit d3d2f8e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion numpy/tests/test_scripts.py
Expand Up @@ -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")
Expand Down

0 comments on commit d3d2f8e

Please sign in to comment.