From: Ankit Kumar Pandey <93041495+itsankitkp@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:14:14 +0000 (+0530) Subject: gh-103724: Add test case if no arg as provided in os.register_at_fork (gh-103725) X-Git-Tag: v3.12.0b1~472 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7255bbd4a1841447a21c3eb74e4fd9e21818d833;p=thirdparty%2FPython%2Fcpython.git gh-103724: Add test case if no arg as provided in os.register_at_fork (gh-103725) --- diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 77f42f7f9c93..444f8abe4607 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='')