Skip to content

Commit

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

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

Co-authored-by: Michael Droettboom <[email protected]>
  • Loading branch information
mdboom authored and miss-islington committed Jul 15, 2022
1 parent d9107aa commit d5ebce6
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 d5ebce6

Please sign in to comment.