diff options
author | Ankit Kumar Pandey <93041495+itsankitkp@users.noreply.github.com> | 2023-04-24 04:44:14 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-23 17:14:14 -0600 |
commit | 7255bbd4a1841447a21c3eb74e4fd9e21818d833 (patch) | |
tree | cc7e648b1ba4d73eb73d612bd2805b174af08813 | |
parent | 82932b72cabb6a77bbf5465a0a9574f90773aadf (diff) | |
download | cpython-git-7255bbd4a1841447a21c3eb74e4fd9e21818d833.tar.gz |
gh-103724: Add test case if no arg as provided in os.register_at_fork (gh-103725)
-rw-r--r-- | Lib/test/test_posix.py | 3 |
1 files changed, 3 insertions, 0 deletions
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='') |