summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc_super.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/micropython/heapalloc_super.py')
-rw-r--r--tests/micropython/heapalloc_super.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/micropython/heapalloc_super.py b/tests/micropython/heapalloc_super.py
index a8c23393e..51afae3d8 100644
--- a/tests/micropython/heapalloc_super.py
+++ b/tests/micropython/heapalloc_super.py
@@ -4,21 +4,30 @@ import micropython
# Check for stackless build, which can't call functions without
# allocating a frame on heap.
try:
- def stackless(): pass
- micropython.heap_lock(); stackless(); micropython.heap_unlock()
+
+ def stackless():
+ pass
+
+ micropython.heap_lock()
+ stackless()
+ micropython.heap_unlock()
except RuntimeError:
print("SKIP")
raise SystemExit
+
class A:
def foo(self):
- print('A foo')
+ print("A foo")
return 42
+
+
class B(A):
def foo(self):
- print('B foo')
+ print("B foo")
print(super().foo())
+
b = B()
micropython.heap_lock()