From d3d2f8e92cd08bb64cc520cf714bc70fb31909ce Mon Sep 17 00:00:00 2001 From: gfyoung Date: Mon, 25 Jan 2016 18:37:23 +0000 Subject: 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. --- numpy/tests/test_scripts.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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") -- cgit v1.2.1