]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-103724: Add test case if no arg as provided in os.register_at_fork (gh-103725)
authorAnkit Kumar Pandey <93041495+itsankitkp@users.noreply.github.com>
Sun, 23 Apr 2023 23:14:14 +0000 (04:44 +0530)
committerGitHub <noreply@github.com>
Sun, 23 Apr 2023 23:14:14 +0000 (17:14 -0600)
Lib/test/test_posix.py

index 77f42f7f9c937bad575fc2e35248b90442c50df4..444f8abe4607b717c4749057a41c169ce6225dc2 100644 (file)
@@ -231,6 +231,9 @@ class PosixTester(unittest.TestCase):
         with self.assertRaises(TypeError, msg="Invalid arg was allowed"):
             # Ensure a combination of valid and invalid is an error.
             os.register_at_fork(before=None, after_in_parent=lambda: 3)
+        with self.assertRaises(TypeError, msg="At least one argument is required"):
+            # when no arg is passed
+            os.register_at_fork()
         with self.assertRaises(TypeError, msg="Invalid arg was allowed"):
             # Ensure a combination of valid and invalid is an error.
             os.register_at_fork(before=lambda: None, after_in_child='')