summaryrefslogtreecommitdiff
path: root/numpy/tests/test_scripts.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-01-25 14:32:31 -0700
committerCharles Harris <charlesr.harris@gmail.com>2016-01-25 14:32:31 -0700
commit471bab33bbfac24df42221b5c5739a190ca4018e (patch)
tree9c3e323ce5e62a8dfb04f4a0b163552d5a757d52 /numpy/tests/test_scripts.py
parente0acd3fea475429070ff5682225b00aa8f3dbbcf (diff)
parentd3d2f8e92cd08bb64cc520cf714bc70fb31909ce (diff)
downloadnumpy-471bab33bbfac24df42221b5c5739a190ca4018e.tar.gz
Merge pull request #7116 from gfyoung/f2py_patch
TST: Fixed f2py test for win32 virtualenv
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")