summaryrefslogtreecommitdiff
path: root/igor.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-08 09:24:52 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-08 09:42:43 -0400
commitc163cdc44980bb39ec8b9031a38f58ed98766419 (patch)
tree80c1c5bd241a213047d7a30fa000017050680dac /igor.py
parent6217af70939d939b6abfc4abfe32a03bc47da967 (diff)
downloadpython-coveragepy-git-c163cdc44980bb39ec8b9031a38f58ed98766419.tar.gz
test: make metacov work with xdist
I was using pytest.__file__ as a directory, but in 5.3.2, pytest changed to be a package, so that wasn't the site-packages directory anymore, and our .pth file was written someplace useless. Now we don't rely on the structure of pytest (why did we ever?), and it works again.
Diffstat (limited to 'igor.py')
-rw-r--r--igor.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/igor.py b/igor.py
index 0ea93e40..58774036 100644
--- a/igor.py
+++ b/igor.py
@@ -15,6 +15,7 @@ import inspect
import os
import platform
import sys
+import sysconfig
import textwrap
import warnings
import zipfile
@@ -143,7 +144,7 @@ def run_tests_with_coverage(tracer, *runner_args):
# The .pth file seems to have to be alphabetically after easy-install.pth
# or the sys.path entries aren't created right?
# There's an entry in "make clean" to get rid of this file.
- pth_dir = os.path.dirname(pytest.__file__)
+ pth_dir = sysconfig.get_path("purelib")
pth_path = os.path.join(pth_dir, "zzz_metacov.pth")
with open(pth_path, "w") as pth_file:
pth_file.write("import coverage; coverage.process_startup()\n")