Skip to content

Commit bf6c79d

Browse files
committed
exempt runs-in-a-forked-process code from coverage
1 parent b558f7f commit bf6c79d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/zarr/core/sync.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,13 @@ def reset_resources_after_fork() -> None:
9696
forked processes will retain invalid references to the parent process's resources.
9797
"""
9898
global loop, iothread, _executor
99-
loop[0] = None
100-
iothread[0] = None
101-
_executor = None
99+
# These lines are excluded from coverage because this function only runs in a child process,
100+
# which is not observed by the test coverage instrumentation. Despite the apparent lack of
101+
# test coverage, this function should be adequately tested by any test that uses Zarr IO with
102+
# multiprocessing.
103+
loop[0] = None # pragma: no cover
104+
iothread[0] = None # pragma: no cover
105+
_executor = None # pragma: no cover
102106

103107

104108
# this is only available on certain operating systems

0 commit comments

Comments
 (0)