mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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:
parent
9ea72e9d8d
commit
df4d53a09a
1 changed files with 7 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue