diff options
| author | Damien George | 2017-04-19 09:49:48 +1000 |
|---|---|---|
| committer | Damien George | 2017-04-22 23:39:38 +1000 |
| commit | 30badd1ce1fabd26e54fc445f07846306aa19cef (patch) | |
| tree | 67eb4859d6acd8e234532e1a1ea5b4691e5dbdf6 /tests/cmdline | |
| parent | dd11af209d226b7d18d5148b239662e30ed60bad (diff) | |
tests: Add tests for calling super and loading a method directly.
Diffstat (limited to 'tests/cmdline')
| -rw-r--r-- | tests/cmdline/cmd_showbc.py | 4 | ||||
| -rw-r--r-- | tests/cmdline/cmd_showbc.py.exp | 21 |
2 files changed, 24 insertions, 1 deletions
diff --git a/tests/cmdline/cmd_showbc.py b/tests/cmdline/cmd_showbc.py index 2f4e953bb..6e99fc418 100644 --- a/tests/cmdline/cmd_showbc.py +++ b/tests/cmdline/cmd_showbc.py @@ -150,3 +150,7 @@ class Class: # delete name del Class + +# load super method +def f(self): + super().f() diff --git a/tests/cmdline/cmd_showbc.py.exp b/tests/cmdline/cmd_showbc.py.exp index d0baee10f..1e015eb03 100644 --- a/tests/cmdline/cmd_showbc.py.exp +++ b/tests/cmdline/cmd_showbc.py.exp @@ -7,7 +7,7 @@ arg names: (N_EXC_STACK 0) bc=-1 line=1 ######## - bc=\\d\+ line=152 + bc=\\d\+ line=155 00 MAKE_FUNCTION \.\+ \\d\+ STORE_NAME f \\d\+ MAKE_FUNCTION \.\+ @@ -25,6 +25,8 @@ arg names: \\d\+ CALL_FUNCTION n=2 nkw=0 \\d\+ STORE_NAME Class \\d\+ DELETE_NAME Class +\\d\+ MAKE_FUNCTION \.\+ +\\d\+ STORE_NAME f \\d\+ LOAD_CONST_NONE \\d\+ RETURN_VALUE File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes) @@ -428,6 +430,23 @@ arg names: 10 STORE_NAME __qualname__ 13 LOAD_CONST_NONE 14 RETURN_VALUE +File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes) +Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+): +######## +\.\+5b +arg names: self +(N_STATE 4) +(N_EXC_STACK 0) + bc=-1 line=1 + bc=0 line=156 +00 LOAD_GLOBAL super (cache=0) +\\d\+ LOAD_GLOBAL __class__ (cache=0) +\\d\+ LOAD_FAST 0 +\\d\+ LOAD_SUPER_METHOD f +\\d\+ CALL_METHOD n=0 nkw=0 +\\d\+ POP_TOP +\\d\+ LOAD_CONST_NONE +\\d\+ RETURN_VALUE File cmdline/cmd_showbc.py, code block '<genexpr>' (descriptor: \.\+, bytecode @\.\+ bytes) Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+): ######## |
