summaryrefslogtreecommitdiff
path: root/tests/test_process.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-07-30 20:15:01 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-07-30 20:15:01 -0400
commit5eea5dbb59adc5f384d443fb702060e21646adbc (patch)
tree2bd0bef930151bb1a83edcadcd3b079f65e2323b /tests/test_process.py
parent921bb995823e388ac33d726574cea2324c693662 (diff)
downloadpython-coveragepy-git-5eea5dbb59adc5f384d443fb702060e21646adbc.tar.gz
Another test of --append.
Diffstat (limited to 'tests/test_process.py')
-rw-r--r--tests/test_process.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_process.py b/tests/test_process.py
index 654b0135..78d02bc1 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -143,6 +143,30 @@ class ProcessTest(CoverageTest):
data.read_file(".coverage")
self.assertEqual(data.line_counts()['b_or_c.py'], 7)
+ def test_append_data_with_different_file(self):
+ self.make_b_or_c_py()
+
+ self.make_file(".coveragerc", """\
+ [run]
+ data_file = .mycovdata
+ """)
+
+ out = self.run_command("coverage run b_or_c.py b")
+ self.assertEqual(out, 'done\n')
+ self.assert_doesnt_exist(".coverage")
+ self.assert_exists(".mycovdata")
+
+ out = self.run_command("coverage run --append b_or_c.py c")
+ self.assertEqual(out, 'done\n')
+ self.assert_doesnt_exist(".coverage")
+ self.assert_exists(".mycovdata")
+
+ # Read the coverage file and see that b_or_c.py has all 7 lines
+ # executed.
+ data = coverage.CoverageData()
+ data.read_file(".mycovdata")
+ self.assertEqual(data.line_counts()['b_or_c.py'], 7)
+
def test_combine_with_rc(self):
self.make_b_or_c_py()