From df4d53a09ab9fd9116d1b52bdc42133e019ca82b Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 14 Jul 2022 19:53:06 -0400 Subject: [PATCH] gh-94808: Add coverage for boolobject.c:bool_new (GH-94859) `bool_new` had no coverage. Automerge-Triggered-By: GH:brandtbucher --- Lib/test/test_bool.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py index 4b32aad2419f4a..f46f21da8da351 100644 --- a/Lib/test/test_bool.py +++ b/Lib/test/test_bool.py @@ -369,6 +369,13 @@ def f(x): f(x) self.assertGreaterEqual(x.count, 1) + def test_bool_new(self): + self.assertIs(bool.__new__(bool), False) + self.assertIs(bool.__new__(bool, 1), True) + self.assertIs(bool.__new__(bool, 0), False) + self.assertIs(bool.__new__(bool, False), False) + self.assertIs(bool.__new__(bool, True), True) + if __name__ == "__main__": unittest.main()