diff options
author | Éric Larivière <elarivie@users.noreply.github.com> | 2021-01-30 17:55:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-30 17:55:11 -0500 |
commit | a0f6692f5cc9344ae790300dcc0cf743ac9abbd3 (patch) | |
tree | 9884b4de9221850ffe5a10f919322d2ffeabdcef /tests/test_process.py | |
parent | 0143891b04c0c800fe1a508ab424cbe825f4210b (diff) | |
download | python-coveragepy-git-a0f6692f5cc9344ae790300dcc0cf743ac9abbd3.tar.gz |
Add combine --keep (#1110)
* Add combine --keep
Related to https://github.com/nedbat/coveragepy/issues/1108
* Fix unit tests
* Fix line too long
* Fix line too long
Diffstat (limited to 'tests/test_process.py')
-rw-r--r-- | tests/test_process.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_process.py b/tests/test_process.py index e4886156..b44147a3 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -244,6 +244,28 @@ class ProcessTest(CoverageTest): data.read() self.assertEqual(line_counts(data)['b_or_c.py'], 7) + def test_combine_parallel_data_keep(self): + self.make_b_or_c_py() + out = self.run_command("coverage run -p b_or_c.py b") + self.assertEqual(out, 'done\n') + self.assert_doesnt_exist(".coverage") + self.assert_file_count(".coverage.*", 1) + + out = self.run_command("coverage run -p b_or_c.py c") + self.assertEqual(out, 'done\n') + self.assert_doesnt_exist(".coverage") + + # After two -p runs, there should be two .coverage.machine.123 files. + self.assert_file_count(".coverage.*", 2) + + # Combine the parallel coverage data files into .coverage with the keep flag. + self.run_command("coverage combine --keep") + + # After combining, the .coverage file & the original combined file should still be there. + self.assert_exists(".coverage") + self.assert_file_count(".coverage.*", 2) + + def test_append_data(self): self.make_b_or_c_py() |