summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc_fail_tuple.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/micropython/heapalloc_fail_tuple.py')
-rw-r--r--tests/micropython/heapalloc_fail_tuple.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/micropython/heapalloc_fail_tuple.py b/tests/micropython/heapalloc_fail_tuple.py
new file mode 100644
index 000000000..1cd23fb74
--- /dev/null
+++ b/tests/micropython/heapalloc_fail_tuple.py
@@ -0,0 +1,12 @@
+# test handling of failed heap allocation with tuple
+
+import micropython
+
+# create tuple
+x = 1
+micropython.heap_lock()
+try:
+ (x,)
+except MemoryError:
+ print('MemoryError: tuple create')
+micropython.heap_unlock()