summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc_fail_tuple.py
blob: 11718a8107b3a871e54c0e2be9d8c6e9272a2a7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# test handling of failed heap allocation with tuple

try:
    import micropython

    micropython.heap_lock
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit

# create tuple
x = 1
micropython.heap_lock()
try:
    (x,)
except MemoryError:
    print("MemoryError: tuple create")
micropython.heap_unlock()