From a0f6692f5cc9344ae790300dcc0cf743ac9abbd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Larivi=C3=A8re?= Date: Sat, 30 Jan 2021 17:55:11 -0500 Subject: 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 --- coverage/control.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 8d129bcb..c952afcd 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -659,7 +659,7 @@ class Coverage(object): data = self.get_data() data.write() - def combine(self, data_paths=None, strict=False): + def combine(self, data_paths=None, strict=False, keep=False): """Combine together a number of similarly-named coverage data files. All coverage data files whose name starts with `data_file` (from the @@ -674,6 +674,8 @@ class Coverage(object): If `strict` is true, then it is an error to attempt to combine when there are no data files to combine. + If `keep` is true, then combined data files won't be deleted. + .. versionadded:: 4.0 The `data_paths` parameter. @@ -694,7 +696,8 @@ class Coverage(object): for pattern in paths[1:]: aliases.add(pattern, result) - combine_parallel_data(self._data, aliases=aliases, data_paths=data_paths, strict=strict) + combine_parallel_data(self._data, + aliases=aliases, data_paths=data_paths, strict=strict, keep=keep) def get_data(self): """Get the collected data. -- cgit v1.2.1