From 7255bbd4a1841447a21c3eb74e4fd9e21818d833 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Pandey <93041495+itsankitkp@users.noreply.github.com> Date: Mon, 24 Apr 2023 04:44:14 +0530 Subject: gh-103724: Add test case if no arg as provided in os.register_at_fork (gh-103725) --- Lib/test/test_posix.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 77f42f7f9c..444f8abe46 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -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='') -- cgit v1.2.1