summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-06-25 08:35:00 -0400
committerNed Batchelder <ned@nedbatchelder.com>2016-06-25 08:35:00 -0400
commit609bd9a53c89d6449ee504c266b3d02c15a097d0 (patch)
tree8fe3f796f01d4f5c453dd942b6f17a40b8f52c0b /tests
parente058c1162e9d1c0f405a2f3a0fe55338a515f770 (diff)
downloadpython-coveragepy-git-609bd9a53c89d6449ee504c266b3d02c15a097d0.tar.gz
Combine no longer appends by default
Combine used to always load an existing .coverage file. This lead to confusing results and extra tox-clean steps. Now the default is to not load the existing file, though a new --append switch on coverage combine gets you that behavior if you need it. This also pointed up an issue with concurrency=multiprocessing, which is that the child processes automatically used parallel=True, but the parent process did not. Now concurrency=multiprocessing implies parallel=True.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cmdline.py9
-rw-r--r--tests/test_process.py2
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index 8e2840b4..795a01fb 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -190,6 +190,12 @@ class CmdLineTest(BaseCmdLineTest):
# coverage combine with args
self.cmd_executes("combine datadir1", """\
.coverage()
+ .combine(["datadir1"])
+ .save()
+ """)
+ # coverage combine, appending
+ self.cmd_executes("combine --append datadir1", """\
+ .coverage()
.load()
.combine(["datadir1"])
.save()
@@ -197,7 +203,6 @@ class CmdLineTest(BaseCmdLineTest):
# coverage combine without args
self.cmd_executes("combine", """\
.coverage()
- .load()
.combine(None)
.save()
""")
@@ -206,13 +211,11 @@ class CmdLineTest(BaseCmdLineTest):
# https://bitbucket.org/ned/coveragepy/issues/385/coverage-combine-doesnt-work-with-rcfile
self.cmd_executes("combine --rcfile cov.ini", """\
.coverage(config_file='cov.ini')
- .load()
.combine(None)
.save()
""")
self.cmd_executes("combine --rcfile cov.ini data1 data2/more", """\
.coverage(config_file='cov.ini')
- .load()
.combine(["data1", "data2/more"])
.save()
""")
diff --git a/tests/test_process.py b/tests/test_process.py
index 5e0014ef..328bd9e3 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -150,7 +150,7 @@ class ProcessTest(CoverageTest):
self.assertEqual(self.number_of_data_files(), 2)
# Combine the parallel coverage data files into .coverage .
- self.run_command("coverage combine")
+ self.run_command("coverage combine --append")
self.assert_exists(".coverage")
# After combining, there should be only the .coverage file.