Skip to content

Commit 135067a

Browse files
committed
gh-146325: Use test.support.requires_fork in test_fastpath_cache_cleared_in_forked_child
Tests that need fork have to call test.support.requires_fork() to rule out platforms that have `os.fork()` but where it should not be called
1 parent 1114d7f commit 135067a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Lib/test/test_importlib/metadata/test_zip.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
import unittest
55

6-
from test.support import warnings_helper
6+
from test.support import requires_fork, warnings_helper
77

88
from importlib.metadata import (
99
FastPath,
@@ -53,11 +53,7 @@ def test_one_distribution(self):
5353
assert len(dists) == 1
5454

5555
@warnings_helper.ignore_fork_in_thread_deprecation_warnings()
56-
@unittest.skipUnless(
57-
hasattr(os, 'register_at_fork')
58-
and 'fork' in multiprocessing.get_all_start_methods(),
59-
'requires fork-based multiprocessing support',
60-
)
56+
@requires_fork()
6157
def test_fastpath_cache_cleared_in_forked_child(self):
6258
zip_path = sys.path[0]
6359

0 commit comments

Comments
 (0)