From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 25 Feb 2023 21:09:39 +0000 (-0800) Subject: gh-102252: Improve coverage of test_bool.py (GH-102253) X-Git-Tag: v3.10.11~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f894995eb606a2cf831be56383720adc23ebcb80;p=thirdparty%2FPython%2Fcpython.git 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> --- diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py index 4b32aad2419f..5215f775c615 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)