diff options
Diffstat (limited to 'Lib/test/test_bool.py')
-rw-r--r-- | Lib/test/test_bool.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py index d30a3b9c0f2..5f7e842da2d 100644 --- a/Lib/test/test_bool.py +++ b/Lib/test/test_bool.py @@ -333,6 +333,17 @@ class BoolTest(unittest.TestCase): except (Exception) as e_len: self.assertEqual(str(e_bool), str(e_len)) + def test_blocked(self): + class A: + __bool__ = None + self.assertRaises(TypeError, bool, A()) + + class B: + def __len__(self): + return 10 + __bool__ = None + self.assertRaises(TypeError, bool, B()) + def test_real_and_imag(self): self.assertEqual(True.real, 1) self.assertEqual(True.imag, 0) |