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

Function _flush_coverage

tests/fork_helpers.py:48–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46
47
48def _flush_coverage() -> None: # pragma: win32 no cover - a spawned child inherits no coverage to flush
49 # An unmeasured run has nothing to write, and importing coverage there would stop the suite from running at all.
50 if not CAPABILITIES["coverage"]: # pragma: lacks coverage
51 return
52 from coverage import Coverage
53
54 # Reaching the other side needs coverage inactive, which is when nothing gets recorded anyway.
55 if (coverage := Coverage.current()) is not None: # pragma: no branch
56 coverage.save()
57
58
59def _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