8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd98be8 commit b94d85bCopy full SHA for b94d85b
Lib/test/test_bool.py
@@ -59,9 +59,15 @@ def test_math(self):
59
self.assertEqual(abs(True), 1)
60
self.assertIsNot(abs(True), True)
61
with self.assertWarns(DeprecationWarning):
62
- self.assertEqual(~False, -1)
+ # WE need to put the bool in a variable, because the constant
63
+ # ~False is evaluated at compile time due to constant folding;
64
+ # consequently the DeprecationWarning would be issued during setup
65
+ # and not during test execution
66
+ false = False
67
+ self.assertEqual(~false, -1)
68
- self.assertEqual(~True, -2)
69
+ true = True
70
+ self.assertEqual(~true, -2)
71
72
self.assertEqual(False+2, 2)
73
self.assertEqual(True+2, 3)
0 commit comments