gh-94808: Add coverage for boolobject.c:bool_new (GH-94859) (GH-94883)

`bool_new` had no coverage.

Automerge-Triggered-By: GH:brandtbucher
(cherry picked from commit df4d53a09a)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-07-15 10:37:13 -07:00 committed by GitHub
parent e55f60db8f
commit 8dc4de3aaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()