Skip to content

Commit

Permalink
pythongh-103724: Add test case if no arg as provided in os.register_a…
Browse files Browse the repository at this point in the history
…t_fork (pythongh-103725)
  • Loading branch information
itsankitkp authored Apr 23, 2023
1 parent 82932b7 commit 7255bbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/test/test_posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ def test_register_at_fork(self):
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='')
Expand Down

0 comments on commit 7255bbd

Please sign in to comment.