Enable __floor__, __ceil__ test snippet for float
The test of __floor__ and __ceil__ for float will be activated
when python version is greater then or equal to 3.9
import math
-from testutils import assert_raises
+from testutils import assert_raises, skip_if_unsupported
NAN = float('nan')
INF = float('inf')
@@ -21,11 +21,19 @@ assert int.__floor__
assert int.__ceil__
# assert float.__trunc__
-with assert_raises(AttributeError):
+
+
+def float_floor_exists():
assert float.__floor__
-with assert_raises(AttributeError):
+
+
+def float_ceil_exists():
assert float.__ceil__
+
+skip_if_unsupported(3, 9, float_floor_exists)
+skip_if_unsupported(3, 9, float_ceil_exists)
+
assert math.trunc(2) == 2
assert math.ceil(3) == 3
assert math.floor(4) == 4
