summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.rst5
-rw-r--r--tests/test_process.py7
2 files changed, 12 insertions, 0 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index bacf3339..14300c8f 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,11 @@ Change history for Coverage.py
Unreleased
----------
+- Subprocesses that are measured with `automatic subprocess measurement`_ used
+ to read in any pre-existing data file. This meant data would be incorrectly
+ carried forward from run to run. Now those files are not read, so each
+ subprocess only writes its own data.
+
- Corrected the name of the jquery.ba-throttle-debounce.js library. Thanks,
Ben Finney. Closes `issue 505`_.
diff --git a/tests/test_process.py b/tests/test_process.py
index 5848b9ff..53d2362a 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -1088,6 +1088,13 @@ class ProcessStartupTest(ProcessCoverageMixin, CoverageTest):
if env.METACOV:
self.skipTest("Can't test sub-process pth file suppport during metacoverage")
+ # An existing data file should not be read when a subprocess gets
+ # measured automatically. Create the data file here with bogus data in
+ # it.
+ data = coverage.CoverageData()
+ data.add_lines({os.path.abspath('sub.py'): dict.fromkeys(range(100))})
+ data.write_file(".mycovdata")
+
self.make_file("coverage.ini", """\
[run]
data_file = .mycovdata