diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-03 21:25:02 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-03 21:25:02 -0400 |
commit | f06e02ebdcea3c5c585b784c568b99ea949cba90 (patch) | |
tree | 440bfbdc207ea12139e5e8f959481cf7f5ca4447 /tests/test_process.py | |
parent | 10f4e01ba81a1d840e43b5888a4d293e6059e1b9 (diff) | |
download | python-coveragepy-git-f06e02ebdcea3c5c585b784c568b99ea949cba90.tar.gz |
Fix --append trying to make a new file. #392
Diffstat (limited to 'tests/test_process.py')
-rw-r--r-- | tests/test_process.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_process.py b/tests/test_process.py index fcd88827..9bd72119 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -168,6 +168,20 @@ class ProcessTest(CoverageTest): data.read_file(".mycovdata") self.assertEqual(data.line_counts()['b_or_c.py'], 7) + def test_append_can_create_a_data_file(self): + self.make_b_or_c_py() + + out = self.run_command("coverage run --append b_or_c.py b") + self.assertEqual(out, 'done\n') + self.assert_exists(".coverage") + self.assertEqual(self.number_of_data_files(), 1) + + # Read the coverage file and see that b_or_c.py has only 6 lines + # executed. + data = coverage.CoverageData() + data.read_file(".coverage") + self.assertEqual(data.line_counts()['b_or_c.py'], 6) + def test_combine_with_rc(self): self.make_b_or_c_py() |