diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2017-08-29 19:14:00 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2017-08-29 19:14:00 -0600 |
commit | 8df22d3a4e17988bd1432a252b0d641f85b09600 (patch) | |
tree | 66479a0dc1c83d4294d1aa076641026c4ae220ca /runtests.py | |
parent | 0032e535f7ebbcb4528dbbedb9c71b47914071c7 (diff) | |
download | numpy-8df22d3a4e17988bd1432a252b0d641f85b09600.tar.gz |
BUG: Fix broken runtests '-t' option.
The '-t' was broken when init files were added to the tests directories,
as it was no longer valid to import tests from the numpy git repo. The
fix here is the use a path to the installed numpy. Which numpy that is
depends on the '--no-build' option.
[ci skip]
Diffstat (limited to 'runtests.py')
-rwxr-xr-x | runtests.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtests.py b/runtests.py index 7d746a3e0..976a0cbbf 100755 --- a/runtests.py +++ b/runtests.py @@ -157,6 +157,9 @@ def main(argv): sys.path.insert(0, site_dir) sys.path.insert(0, site_dir_noarch) os.environ['PYTHONPATH'] = site_dir + os.pathsep + site_dir_noarch + else: + _temp = __import__(PROJECT_MODULE) + site_dir = os.path.sep.join(_temp.__file__.split(os.path.sep)[:-2]) extra_argv = args.args[:] if extra_argv and extra_argv[0] == '--': @@ -273,8 +276,7 @@ def main(argv): def fix_test_path(x): # fix up test path p = x.split(':') - p[0] = os.path.relpath(os.path.abspath(p[0]), - test_dir) + p[0] = os.path.join(site_dir, p[0]) return ':'.join(p) tests = [fix_test_path(x) for x in args.tests] |