diff options
| author | Damien George <damien.p.george@gmail.com> | 2017-04-19 09:49:48 +1000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2017-04-22 23:39:38 +1000 |
| commit | 30badd1ce1fabd26e54fc445f07846306aa19cef (patch) | |
| tree | 67eb4859d6acd8e234532e1a1ea5b4691e5dbdf6 /tests/micropython | |
| parent | dd11af209d226b7d18d5148b239662e30ed60bad (diff) | |
tests: Add tests for calling super and loading a method directly.
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 |
