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>
This commit is contained in:
parent
5f6e689124
commit
ad6750b22e
@ -59,7 +59,7 @@ print("power of 10 test: %s" % (testpass and "passed" or "failed"))
|
|||||||
def fp2int_test(num, name, should_fail):
|
def fp2int_test(num, name, should_fail):
|
||||||
try:
|
try:
|
||||||
x = int(num)
|
x = int(num)
|
||||||
passed = ~should_fail
|
passed = not should_fail
|
||||||
except:
|
except:
|
||||||
passed = should_fail
|
passed = should_fail
|
||||||
print("%s: %s" % (name, passed and "passed" or "failed"))
|
print("%s: %s" % (name, passed and "passed" or "failed"))
|
||||||
|
|||||||
@ -56,7 +56,7 @@ print("power of 10 test: %s" % (testpass and "passed" or "failed"))
|
|||||||
def fp2int_test(num, name, should_fail):
|
def fp2int_test(num, name, should_fail):
|
||||||
try:
|
try:
|
||||||
x = int(num)
|
x = int(num)
|
||||||
passed = ~should_fail
|
passed = not should_fail
|
||||||
except:
|
except:
|
||||||
passed = should_fail
|
passed = should_fail
|
||||||
print("%s: %s" % (name, passed and "passed" or "failed"))
|
print("%s: %s" % (name, passed and "passed" or "failed"))
|
||||||
|
|||||||
@ -59,7 +59,7 @@ print("power of 10 test: %s" % (testpass and "passed" or "failed"))
|
|||||||
def fp2int_test(num, name, should_fail):
|
def fp2int_test(num, name, should_fail):
|
||||||
try:
|
try:
|
||||||
x = int(num)
|
x = int(num)
|
||||||
passed = ~should_fail
|
passed = not should_fail
|
||||||
except:
|
except:
|
||||||
passed = should_fail
|
passed = should_fail
|
||||||
print("%s: %s" % (name, passed and "passed" or "failed"))
|
print("%s: %s" % (name, passed and "passed" or "failed"))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user