summaryrefslogtreecommitdiff
path: root/tests/test_process.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-08-07 11:53:27 -0400
committerNed Batchelder <ned@nedbatchelder.com>2016-08-07 11:53:27 -0400
commitb3d626c3936d11c189b8e810ccb93ceaa019b156 (patch)
treed25f408e9400368eb36baaab82139a4c47594b22 /tests/test_process.py
parent0e8b701b7ff23608d759188876ac3c9bf8669a47 (diff)
downloadpython-coveragepy-git-b3d626c3936d11c189b8e810ccb93ceaa019b156.tar.gz
Combining twice shouldn't lose data. #412, #516
Diffstat (limited to 'tests/test_process.py')
-rw-r--r--tests/test_process.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_process.py b/tests/test_process.py
index 53d2362a..f7f46ab0 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -95,6 +95,17 @@ class ProcessTest(CoverageTest):
data.read_file(".coverage")
self.assertEqual(data.line_counts()['b_or_c.py'], 7)
+ # Running combine again should fail, because there are no parallel data
+ # files to combine.
+ status, out = self.run_command_status("coverage combine")
+ self.assertEqual(status, 1)
+ self.assertEqual(out, "No data to combine\n")
+
+ # And the originally combined data is still there.
+ data = coverage.CoverageData()
+ data.read_file(".coverage")
+ self.assertEqual(data.line_counts()['b_or_c.py'], 7)
+
def test_combine_parallel_data_with_a_corrupt_file(self):
self.make_b_or_c_py()
out = self.run_command("coverage run -p b_or_c.py b")
@@ -732,7 +743,6 @@ class ProcessTest(CoverageTest):
inst.start()
import foo
inst.stop()
- inst.combine()
inst.save()
""")
out = self.run_command("python run_twice.py")