Skip to content

Commit 806c07c

Browse files
committed
tests/micropython/heapalloc_iter: Improve skippability.
1 parent 28876d3 commit 806c07c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/micropython/heapalloc_iter.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# test that iterating doesn't use the heap
2+
try:
3+
import array
4+
except ImportError:
5+
import sys
6+
print("SKIP")
7+
sys.exit()
28

39
try:
410
from micropython import heap_lock, heap_unlock
511
except (ImportError, AttributeError):
612
heap_lock = heap_unlock = lambda:0
7-
import array
813

914
def do_iter(l):
1015
for i in l:
@@ -20,7 +25,7 @@ def gen_func():
2025
t = (1, 2, 3)
2126
l = [1, 2]
2227
d = {1:2}
23-
s = {1}
28+
s = set((1,))
2429
fs = frozenset((1,))
2530
g1 = (100 + x for x in range(2))
2631
g2 = gen_func()

0 commit comments

Comments
 (0)