summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2017-08-30 11:02:10 -0500
committerGitHub <noreply@github.com>2017-08-30 11:02:10 -0500
commit7172b077a5cb560ace33623e1e8c852b36762a90 (patch)
tree268c5024a476d8cb048163d535ddc54a35edda1a
parent912a05b194816ec5c4b9ab775fefefa1388434b0 (diff)
parent8df22d3a4e17988bd1432a252b0d641f85b09600 (diff)
downloadnumpy-7172b077a5cb560ace33623e1e8c852b36762a90.tar.gz
Merge pull request #9626 from charris/fix-runtests
BUG: Fix broken runtests '-t' option.
-rwxr-xr-xruntests.py6
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]