summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-01-22 01:17:30 +0100
committerBas van Beek <b.f.van.beek@vu.nl>2021-01-22 01:17:30 +0100
commit605f82c977f2e00250d26a779fcd521ba6f38848 (patch)
treeccad5743516dedda688c8044a3415d05ed0aa302
parenta6289b5c2b60b15371605ab95f5ed53dd60d7f14 (diff)
downloadnumpy-605f82c977f2e00250d26a779fcd521ba6f38848.tar.gz
MAINT: Manually assign the full path rather than using `os.path.abspath`
Fixes an issue with the azure (windows) tests where `abspath` would point to the wrong directory
-rw-r--r--numpy/typing/tests/test_typing.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/typing/tests/test_typing.py b/numpy/typing/tests/test_typing.py
index ef169b4ed..a0d92feb9 100644
--- a/numpy/typing/tests/test_typing.py
+++ b/numpy/typing/tests/test_typing.py
@@ -42,6 +42,7 @@ def run_mypy() -> None:
if os.path.isdir(CACHE_DIR):
shutil.rmtree(CACHE_DIR)
+ root = os.path.dirname(os.path.dirname(np.__file__))
for directory in (PASS_DIR, REVEAL_DIR, FAIL_DIR):
# Run mypy
stdout, stderr, _ = api.run([
@@ -57,7 +58,7 @@ def run_mypy() -> None:
# Parse the output
key = lambda n: n.split(':', 1)[0]
iterator = itertools.groupby(stdout.split("\n"), key=key)
- OUTPUT_MYPY.update((os.path.abspath(k), list(v)) for k, v in iterator)
+ OUTPUT_MYPY.update((os.path.join(root, k), list(v)) for k, v in iterator)
def get_test_cases(directory):