Skip to content

Commit 6b1e878

Browse files
ryanhiebertionelmc
authored andcommitted
New coverage instance to combine
1 parent 00441a9 commit 6b1e878

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/pytest_cov/engine.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,16 @@ def finish(self):
152152

153153
self.unset_env()
154154
self.cov.stop()
155+
self.cov.save()
156+
157+
# Create a new coverage instance to combine the files.
158+
# Replace the old instance with the new one so that it is
159+
# used for reporting.
160+
self.cov = coverage.coverage(source=self.cov_source,
161+
config_file=self.cov_config)
155162
self.cov.combine()
156163
self.cov.save()
164+
157165
node_desc = self.get_node_desc(sys.platform, sys.version_info)
158166
self.node_descs.add(node_desc)
159167

0 commit comments

Comments
 (0)