summaryrefslogtreecommitdiff
path: root/tests/test_process.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-12-06 06:23:34 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-12-06 06:23:34 -0500
commit97ef1e990ed0c89abb5162a35823e70b8adfb686 (patch)
tree4f9153ca50027b72f6bceb1e0c690dd65d356857 /tests/test_process.py
parent1607bdbcf8dfc59d3226ee5b8745a4a1d0a0bb75 (diff)
downloadpython-coveragepy-git-97ef1e990ed0c89abb5162a35823e70b8adfb686.tar.gz
Remove the filelock experiment
Diffstat (limited to 'tests/test_process.py')
-rw-r--r--tests/test_process.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/test_process.py b/tests/test_process.py
index 141b253a..8ff9fbc9 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -1092,22 +1092,18 @@ for pth_dir in possible_pth_dirs(): # pragma: part covered
else: # pragma: not covered
PTH_DIR = None
-import filelock
-if PTH_DIR:
- pth_lock = filelock.FileLock(os.path.join(PTH_DIR, "pth.lock"))
-
class ProcessCoverageMixin(object):
"""Set up a .pth file to coverage-measure all sub-processes."""
def setUp(self):
super(ProcessCoverageMixin, self).setUp()
- pth_lock.acquire()
- self.addCleanup(pth_lock.release)
- # Find a place to put a .pth file.
+ # Create the .pth file.
+ self.assert_(PTH_DIR)
pth_contents = "import coverage; coverage.process_startup()\n"
- pth_path = os.path.join(pth_dir, "subcover.pth")
+ worker = os.environ.get('PYTEST_XDIST_WORKER', '')
+ pth_path = os.path.join(PTH_DIR, "subcover_{0}.pth".format(worker))
with open(pth_path, "w") as pth:
pth.write(pth_contents)
self.pth_path = pth_path