Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita6e3366

Browse files
committed
Also test that the deprecation warning is emitted in case of constant folding
1 parent5acbe37 commita6e3366

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎Lib/test/test_bool.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,15 @@ def test_math(self):
6565
# module loading and not during test execution.
6666
false=False
6767
self.assertEqual(~false,-1)
68+
withself.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)
6872
withself.assertWarns(DeprecationWarning):
6973
true=True
7074
self.assertEqual(~true,-2)
75+
withself.assertWarns(DeprecationWarning):
76+
self.assertEqual(eval("~True"),-2)
7177

7278
self.assertEqual(False+2,2)
7379
self.assertEqual(True+2,3)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp