Skip to content

Commit a0cbc10

Browse files
committed
tests/float: Make various tests skippable.
1 parent 9831444 commit a0cbc10

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

tests/float/array_construct.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# test construction of array from array with float type
22

3-
from array import array
3+
try:
4+
from array import array
5+
except ImportError:
6+
import sys
7+
print("SKIP")
8+
sys.exit()
49

510
print(array('f', array('h', [1, 2])))
611
print(array('d', array('f', [1, 2])))

tests/float/builtin_float_minmax.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# test builtin min and max functions with float args
2+
try:
3+
min
4+
max
5+
except:
6+
import sys
7+
print("SKIP")
8+
sys.exit()
29

310
print(min(0,1.0))
411
print(min(1.0,0))

tests/float/float_array.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from array import array
1+
try:
2+
from array import array
3+
except ImportError:
4+
import sys
5+
print("SKIP")
6+
sys.exit()
27

38
def test(a):
49
print(a)

tests/float/float_struct.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# test struct package with floats
2-
32
try:
4-
import ustruct as struct
5-
except:
6-
import struct
3+
try:
4+
import ustruct as struct
5+
except:
6+
import struct
7+
except ImportError:
8+
import sys
9+
print("SKIP")
10+
sys.exit()
711

812
i = 1. + 1/2
913
# TODO: it looks like '=' format modifier is not yet supported

0 commit comments

Comments
 (0)