Skip to content

Commit

Permalink
gh-94808: Add coverage for boolobject.c:bool_new (GH-94859)
Browse files Browse the repository at this point in the history
`bool_new` had no coverage.

Automerge-Triggered-By: GH:brandtbucher
  • Loading branch information
mdboom authored Jul 14, 2022
1 parent 9ea72e9 commit df4d53a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Lib/test/test_bool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit df4d53a

Please sign in to comment.