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

`bool_new` had no coverage.

Automerge-Triggered-By: GH:brandtbucher
This commit is contained in:
Michael Droettboom 2022-07-14 19:53:06 -04:00 committed by GitHub
parent 9ea72e9d8d
commit df4d53a09a
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()