Skip to content

Commit 64189d8

Browse files
Reset test duration at start of test
After comments by @Otto-AA, who pointed out that although my changes are good _now_, they would be less likely to break in future if we explicitly reset the accumulated test duration, so this commit does just that.
1 parent 5ab6b77 commit 64189d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mutmut/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,10 @@ def execute_pytest(self, params: list[str], **kwargs):
417417

418418
def run_stats(self, *, tests):
419419
class StatsCollector:
420+
# noinspection PyMethodMayBeStatic
421+
def pytest_runtest_logstart(self, nodeid, location):
422+
mutmut.duration_by_test[nodeid] = 0
423+
420424
# noinspection PyMethodMayBeStatic
421425
def pytest_runtest_teardown(self, item, nextitem):
422426
unused(nextitem)

0 commit comments

Comments
 (0)