summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-04-19 07:28:48 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-04-19 07:28:48 -0400
commitaf251885641cbf85ba8f42b1e3fac7b70bf5a816 (patch)
treee508dd6120887cdb3734662ef98a9ce1dcd407ea
parent0aed59a6c002c94e12a89b6c1400ecd0420dc2f9 (diff)
downloadpython-coveragepy-af251885641cbf85ba8f42b1e3fac7b70bf5a816.tar.gz
Now with COVERAGE_RCFILE, no need for multiprocessing to do its own env thing
-rw-r--r--coverage/multiproc.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/coverage/multiproc.py b/coverage/multiproc.py
index b040765..93b3155 100644
--- a/coverage/multiproc.py
+++ b/coverage/multiproc.py
@@ -14,9 +14,6 @@ from coverage.misc import contract
# monkey-patched.
PATCHED_MARKER = "_coverage$patched"
-# The environment variable that specifies the rcfile for subprocesses.
-COVERAGE_RCFILE_ENV = "_COVERAGE_RCFILE"
-
if sys.version_info >= (3, 4):
OriginalProcess = multiprocessing.process.BaseProcess
@@ -31,8 +28,7 @@ class ProcessWithCoverage(OriginalProcess):
def _bootstrap(self):
"""Wrapper around _bootstrap to start coverage."""
from coverage import Coverage # avoid circular import
- rcfile = os.environ[COVERAGE_RCFILE_ENV]
- cov = Coverage(data_suffix=True, config_file=rcfile)
+ cov = Coverage(data_suffix=True)
cov._warn_preimported_source = False
cov.start()
debug = cov._debug
@@ -81,7 +77,7 @@ def patch_multiprocessing(rcfile):
# Set the value in ProcessWithCoverage that will be pickled into the child
# process.
- os.environ[COVERAGE_RCFILE_ENV] = rcfile
+ os.environ["COVERAGE_RCFILE"] = rcfile
# When spawning processes rather than forking them, we have no state in the
# new process. We sneak in there with a Stowaway: we stuff one of our own