diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-02-25 21:09:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-25 21:09:39 (GMT) |
commit | f894995eb606a2cf831be56383720adc23ebcb80 (patch) | |
tree | 856d7cff37ea93d1f106c19dc9ab329287d47db5 | |
parent | ac631697928505708e41b181c5692fc8c3db7e90 (diff) | |
download | cpython-f894995eb606a2cf831be56383720adc23ebcb80.zip cpython-f894995eb606a2cf831be56383720adc23ebcb80.tar.gz cpython-f894995eb606a2cf831be56383720adc23ebcb80.tar.bz2 |
gh-102252: Improve coverage of test_bool.py (GH-102253)
Add tests for conversion from bool to complex.
(cherry picked from commit 41970436373f4be813fe8f5a07b6da04d5f4c80e)
Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
-rw-r--r-- | Lib/test/test_bool.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py index 4b32aad..5215f77 100644 --- a/Lib/test/test_bool.py +++ b/Lib/test/test_bool.py @@ -40,6 +40,12 @@ class BoolTest(unittest.TestCase): 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) |