Skip to content
Snippets Groups Projects
Commit 806c07c8 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests/micropython/heapalloc_iter: Improve skippability.

parent 28876d39
No related branches found
No related tags found
No related merge requests found
# test that iterating doesn't use the heap # test that iterating doesn't use the heap
try:
import array
except ImportError:
import sys
print("SKIP")
sys.exit()
try: try:
from micropython import heap_lock, heap_unlock from micropython import heap_lock, heap_unlock
except (ImportError, AttributeError): except (ImportError, AttributeError):
heap_lock = heap_unlock = lambda:0 heap_lock = heap_unlock = lambda:0
import array
def do_iter(l): def do_iter(l):
for i in l: for i in l:
...@@ -20,7 +25,7 @@ ar = array.array('H', (123, 456)) ...@@ -20,7 +25,7 @@ ar = array.array('H', (123, 456))
t = (1, 2, 3) t = (1, 2, 3)
l = [1, 2] l = [1, 2]
d = {1:2} d = {1:2}
s = {1} s = set((1,))
fs = frozenset((1,)) fs = frozenset((1,))
g1 = (100 + x for x in range(2)) g1 = (100 + x for x in range(2))
g2 = gen_func() g2 = gen_func()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment