bpo-40280: Add requires_fork test helper (GH-30622)

This commit is contained in:
Christian Heimes 2022-01-16 23:52:43 +02:00 committed by GitHub
parent 5cd9a162cd
commit 91e33ac3d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 34 additions and 18 deletions

View file

@ -1293,7 +1293,7 @@ class TestModule(unittest.TestCase):
# tests validity but not completeness of the __all__ list
self.assertTrue(set(random.__all__) <= set(dir(random)))
@unittest.skipUnless(hasattr(os, "fork"), "fork() required")
@test.support.requires_fork()
def test_after_fork(self):
# Test the global Random instance gets reseeded in child
r, w = os.pipe()