Skip to content

Commit ad6750b

Browse files
committed
tests/float: Use "not" instead of ~ to invert bool value.
Otherwise CPython gives a deprecation warning. This test is not actually testing inversion of bools, rather that bit of the test is used to compute the pass/fail result. Signed-off-by: Damien George <damien@micropython.org>
1 parent 5f6e689 commit ad6750b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tests/float/float2int_doubleprec_intbig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
def fp2int_test(num, name, should_fail):
6060
try:
6161
x = int(num)
62-
passed = ~should_fail
62+
passed = not should_fail
6363
except:
6464
passed = should_fail
6565
print("%s: %s" % (name, passed and "passed" or "failed"))

tests/float/float2int_fp30_intbig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
def fp2int_test(num, name, should_fail):
5757
try:
5858
x = int(num)
59-
passed = ~should_fail
59+
passed = not should_fail
6060
except:
6161
passed = should_fail
6262
print("%s: %s" % (name, passed and "passed" or "failed"))

tests/float/float2int_intbig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
def fp2int_test(num, name, should_fail):
6060
try:
6161
x = int(num)
62-
passed = ~should_fail
62+
passed = not should_fail
6363
except:
6464
passed = should_fail
6565
print("%s: %s" % (name, passed and "passed" or "failed"))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy