Skip to content

Commit

Permalink
gh-102252: Improve coverage of test_bool.py (GH-102253)
Browse files Browse the repository at this point in the history
Add tests for conversion from bool to complex.
(cherry picked from commit 4197043)

Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
  • Loading branch information
miss-islington and Eclips4 committed Feb 25, 2023
1 parent 026faf2 commit 3fe7419
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Lib/test/test_bool.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def test_float(self):
self.assertEqual(float(True), 1.0)
self.assertIsNot(float(True), True)

def test_complex(self):
self.assertEqual(complex(False), 0j)
self.assertEqual(complex(False), False)
self.assertEqual(complex(True), 1+0j)
self.assertEqual(complex(True), True)

def test_math(self):
self.assertEqual(+False, 0)
self.assertIsNot(+False, False)
Expand Down

0 comments on commit 3fe7419

Please sign in to comment.