summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEclips4 <80244920+Eclips4@users.noreply.github.com>2023-02-25 20:50:24 (GMT)
committerGitHub <noreply@github.com>2023-02-25 20:50:24 (GMT)
commit41970436373f4be813fe8f5a07b6da04d5f4c80e (patch)
treec5f383713054eda51e23dc98866538e7510dd22d
parenta35fd38b57d3eb05074ca36f3d57e1993c44ddc9 (diff)
downloadcpython-41970436373f4be813fe8f5a07b6da04d5f4c80e.zip
cpython-41970436373f4be813fe8f5a07b6da04d5f4c80e.tar.gz
cpython-41970436373f4be813fe8f5a07b6da04d5f4c80e.tar.bz2
gh-102252: Improve coverage of test_bool.py (#102253)
Add tests for conversion from bool to complex.
-rw-r--r--Lib/test/test_bool.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index f46f21d..b711ffb 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)