diff options
Diffstat (limited to 'tests/micropython')
-rw-r--r-- | tests/micropython/heapalloc_super.py | 17 | ||||
-rw-r--r-- | tests/micropython/heapalloc_super.py.exp | 3 |
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/micropython/heapalloc_super.py b/tests/micropython/heapalloc_super.py new file mode 100644 index 000000000..1cf5293d2 --- /dev/null +++ b/tests/micropython/heapalloc_super.py @@ -0,0 +1,17 @@ +# test super() operations which don't require allocation +import micropython + +class A: + def foo(self): + print('A foo') + return 42 +class B(A): + def foo(self): + print('B foo') + print(super().foo()) + +b = B() + +micropython.heap_lock() +b.foo() +micropython.heap_unlock() diff --git a/tests/micropython/heapalloc_super.py.exp b/tests/micropython/heapalloc_super.py.exp new file mode 100644 index 000000000..5dabd0c7c --- /dev/null +++ b/tests/micropython/heapalloc_super.py.exp @@ -0,0 +1,3 @@ +B foo +A foo +42 |