summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMichael Droettboom <mdboom@gmail.com>2022-07-14 23:53:06 (GMT)
committerGitHub <noreply@github.com>2022-07-14 23:53:06 (GMT)
commitdf4d53a09ab9fd9116d1b52bdc42133e019ca82b (patch)
tree7fdeccbb7ce95fcdf6c2fb8fd04e8d43a7be0ad5 /Lib
parent9ea72e9d8d9c7ff7c0cec4bacf6071ff4f1f6238 (diff)
downloadcpython-df4d53a09ab9fd9116d1b52bdc42133e019ca82b.zip
cpython-df4d53a09ab9fd9116d1b52bdc42133e019ca82b.tar.gz
cpython-df4d53a09ab9fd9116d1b52bdc42133e019ca82b.tar.bz2
gh-94808: Add coverage for boolobject.c:bool_new (GH-94859)
`bool_new` had no coverage. Automerge-Triggered-By: GH:brandtbucher
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_bool.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index 4b32aad..f46f21d 100644
--- a/Lib/test/test_bool.py
+++ b/Lib/test/test_bool.py
@@ -369,6 +369,13 @@ class BoolTest(unittest.TestCase):
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()