From ad6750b22ef160a233acf0fbf52619d13bcf273e Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 28 May 2024 10:49:22 +1000 Subject: [PATCH] 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 --- tests/float/float2int_doubleprec_intbig.py | 2 +- tests/float/float2int_fp30_intbig.py | 2 +- tests/float/float2int_intbig.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/float/float2int_doubleprec_intbig.py b/tests/float/float2int_doubleprec_intbig.py index 402966cace..565698d877 100644 --- a/tests/float/float2int_doubleprec_intbig.py +++ b/tests/float/float2int_doubleprec_intbig.py @@ -59,7 +59,7 @@ print("power of 10 test: %s" % (testpass and "passed" or "failed")) def fp2int_test(num, name, should_fail): try: x = int(num) - passed = ~should_fail + passed = not should_fail except: passed = should_fail print("%s: %s" % (name, passed and "passed" or "failed")) diff --git a/tests/float/float2int_fp30_intbig.py b/tests/float/float2int_fp30_intbig.py index 1b22fe9646..eb65f89502 100644 --- a/tests/float/float2int_fp30_intbig.py +++ b/tests/float/float2int_fp30_intbig.py @@ -56,7 +56,7 @@ print("power of 10 test: %s" % (testpass and "passed" or "failed")) def fp2int_test(num, name, should_fail): try: x = int(num) - passed = ~should_fail + passed = not should_fail except: passed = should_fail print("%s: %s" % (name, passed and "passed" or "failed")) diff --git a/tests/float/float2int_intbig.py b/tests/float/float2int_intbig.py index d047f247f2..17414501c6 100644 --- a/tests/float/float2int_intbig.py +++ b/tests/float/float2int_intbig.py @@ -59,7 +59,7 @@ print("power of 10 test: %s" % (testpass and "passed" or "failed")) def fp2int_test(num, name, should_fail): try: x = int(num) - passed = ~should_fail + passed = not should_fail except: passed = should_fail print("%s: %s" % (name, passed and "passed" or "failed"))