summaryrefslogtreecommitdiff
path: root/numpy/tests/test_scripts.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/tests/test_scripts.py')
-rw-r--r--numpy/tests/test_scripts.py8
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")