Skip to content

Commit 3e321f1

Browse files
committed
tests/misc/: Make few tests skippable.
1 parent 12d0731 commit 3e321f1

4 files changed

Lines changed: 31 additions & 6 deletions

File tree

tests/misc/non_compliant.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# tests for things that are not implemented, or have non-compliant behaviour
22

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

611
# when super can't find self
712
try:

tests/misc/print_exception.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
import sys
12
try:
2-
import uio as io
3+
try:
4+
import uio as io
5+
except ImportError:
6+
import io
37
except ImportError:
4-
import io
5-
import sys
8+
print("SKIP")
9+
sys.exit()
10+
611
if hasattr(sys, 'print_exception'):
712
print_exception = sys.print_exception
813
else:

tests/misc/recursive_data.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# This tests that printing recursive data structure doesn't lead to segfault.
2-
import uio as io
2+
try:
3+
import uio as io
4+
except ImportError:
5+
import sys
6+
print("SKIP")
7+
sys.exit()
38

49
l = [1, 2, 3, None]
510
l[-1] = l

tests/misc/recursive_iternext.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# This tests that recursion with iternext doesn't lead to segfault.
2+
try:
3+
enumerate
4+
filter
5+
map
6+
max
7+
zip
8+
except:
9+
import sys
10+
print("SKIP")
11+
sys.exit()
212

313
# We need to pick an N that is large enough to hit the recursion
414
# limit, but not too large that we run out of heap memory.

0 commit comments

Comments
 (0)