Skip to content

Commit 7255bbd

Browse files
authored
gh-103724: Add test case if no arg as provided in os.register_at_fork (gh-103725)
1 parent 82932b7 commit 7255bbd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_posix.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ def test_register_at_fork(self):
231231
with self.assertRaises(TypeError, msg="Invalid arg was allowed"):
232232
# Ensure a combination of valid and invalid is an error.
233233
os.register_at_fork(before=None, after_in_parent=lambda: 3)
234+
with self.assertRaises(TypeError, msg="At least one argument is required"):
235+
# when no arg is passed
236+
os.register_at_fork()
234237
with self.assertRaises(TypeError, msg="Invalid arg was allowed"):
235238
# Ensure a combination of valid and invalid is an error.
236239
os.register_at_fork(before=lambda: None, after_in_child='')

0 commit comments

Comments
 (0)