There was an error while loading. Please reload this page.
1 parent 5acbe37 commit a6e3366Copy full SHA for a6e3366
Lib/test/test_bool.py
@@ -65,9 +65,15 @@ def test_math(self):
65
# module loading and not during test execution.
66
false = False
67
self.assertEqual(~false, -1)
68
+ with self.assertWarns(DeprecationWarning):
69
+ # also check that the warning is issued in case of constant
70
+ # folding at compile time
71
+ self.assertEqual(eval("~False"), -1)
72
with self.assertWarns(DeprecationWarning):
73
true = True
74
self.assertEqual(~true, -2)
75
76
+ self.assertEqual(eval("~True"), -2)
77
78
self.assertEqual(False+2, 2)
79
self.assertEqual(True+2, 3)
0 commit comments