tests/float: Make various tests skippable.
This commit is contained in:
parent
983144404b
commit
a0cbc108ba
|
@ -1,6 +1,11 @@
|
|||
# test construction of array from array with float type
|
||||
|
||||
from array import array
|
||||
try:
|
||||
from array import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
|
||||
print(array('f', array('h', [1, 2])))
|
||||
print(array('d', array('f', [1, 2])))
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
# test builtin min and max functions with float args
|
||||
try:
|
||||
min
|
||||
max
|
||||
except:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
|
||||
print(min(0,1.0))
|
||||
print(min(1.0,0))
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
from array import array
|
||||
try:
|
||||
from array import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
|
||||
def test(a):
|
||||
print(a)
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
# test struct package with floats
|
||||
|
||||
try:
|
||||
try:
|
||||
import ustruct as struct
|
||||
except:
|
||||
except:
|
||||
import struct
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
|
||||
i = 1. + 1/2
|
||||
# TODO: it looks like '=' format modifier is not yet supported
|
||||
|
|
Loading…
Reference in New Issue