MCPcopy Create free account
hub / github.com/tox-dev/filelock / _flush_coverage

Function _flush_coverage

tests/fork_helpers.py:54–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53
54def _flush_coverage() -> None: # pragma: win32 no cover - a spawned child inherits no coverage to flush
55 # An unmeasured run has nothing to write, and importing coverage there would stop the suite from running at all.
56 if not CAPABILITIES["coverage"]: # pragma: lacks coverage
57 return
58 from coverage import Coverage
59
60 # Reaching the other side needs coverage inactive, which is when nothing gets recorded anyway.
61 if (coverage := Coverage.current()) is not None: # pragma: no branch
62 coverage.save()
63
64
65def _restart_coverage_after_fork() -> None: # pragma: win32 no cover

Callers 1

exit_childFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected