[Python-checkins] gh-102252: Improve coverage of test_bool.py (#102253)
terryjreedy
webhook-mailer at python.org
Sat Feb 25 15:50:35 EST 2023
https://github.com/python/cpython/commit/41970436373f4be813fe8f5a07b6da04d5f4c80e
commit: 41970436373f4be813fe8f5a07b6da04d5f4c80e
branch: main
author: Eclips4 <80244920+Eclips4 at users.noreply.github.com>
committer: terryjreedy <tjreedy at udel.edu>
date: 2023-02-25T15:50:24-05:00
summary:
gh-102252: Improve coverage of test_bool.py (#102253)
Add tests for conversion from bool to complex.
files:
M Lib/test/test_bool.py
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index f46f21da8da3..b711ffb9a3ec 100644
--- a/Lib/test/test_bool.py
+++ b/Lib/test/test_bool.py
@@ -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)
More information about the Python-checkins
mailing list