From df8aaf2acb57da2704ddef808ef0208d6e2d1212 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Pandey Date: Sun, 23 Apr 2023 23:58:46 +0530 Subject: [PATCH 1/4] ensure error is raised when no arg is supplied --- 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 77f42f7f9c937b..5d3b79ae233444 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -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='') From 9f5e6901fe236daa03dbf8de7365d5b667b44c11 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sun, 23 Apr 2023 18:38:14 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Tests/2023-04-23-18-38-13.gh-issue-103724.XE53jS.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Tests/2023-04-23-18-38-13.gh-issue-103724.XE53jS.rst diff --git a/Misc/NEWS.d/next/Tests/2023-04-23-18-38-13.gh-issue-103724.XE53jS.rst b/Misc/NEWS.d/next/Tests/2023-04-23-18-38-13.gh-issue-103724.XE53jS.rst new file mode 100644 index 00000000000000..1189cb45606fc5 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2023-04-23-18-38-13.gh-issue-103724.XE53jS.rst @@ -0,0 +1 @@ +Add test case for missing arg in os.register_at_fork From 22cacf26fd4f8bdd7d47952c541967a7b6598280 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Pandey Date: Mon, 24 Apr 2023 00:35:50 +0530 Subject: [PATCH 3/4] removed news as it was not needed --- .../next/Tests/2023-04-23-18-38-13.gh-issue-103724.XE53jS.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Tests/2023-04-23-18-38-13.gh-issue-103724.XE53jS.rst diff --git a/Misc/NEWS.d/next/Tests/2023-04-23-18-38-13.gh-issue-103724.XE53jS.rst b/Misc/NEWS.d/next/Tests/2023-04-23-18-38-13.gh-issue-103724.XE53jS.rst deleted file mode 100644 index 1189cb45606fc5..00000000000000 --- a/Misc/NEWS.d/next/Tests/2023-04-23-18-38-13.gh-issue-103724.XE53jS.rst +++ /dev/null @@ -1 +0,0 @@ -Add test case for missing arg in os.register_at_fork From 48c22f3bf0232996833611ac416c297a8dfa0e75 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 23 Apr 2023 13:24:45 -0600 Subject: [PATCH 4/4] Update Lib/test/test_posix.py --- Lib/test/test_posix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 5d3b79ae233444..444f8abe4607b7 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -231,7 +231,7 @@ 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."): + 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"):