This commit fixes tests that will always fail when using CPython 3.14
to get a known-good output to compare MicroPython's behaviour against.
Starting from CPython 3.14, statements inside a `finally` block that
will prevent the execution flow to reach the block's last statement will
raise a SyntaxWarning. That text would end up in the comparison data
and thus make known-good tests fail.
Given that those tests explicitly exercise flow control interruptions
in finally blocks, there is no real workaround that can be applied to
the tests themselves. Therefore those tests will now check
MicroPython's behaviour against expected output files recorded from
the tests' output with CPython 3.11.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Running the tests now requires CPython 3.8.2 or newer, which was
released February 2020 and should be widely available.
A few examples of features that were previously not supported by CPython,
but which are now:
- %-formatting for bytes and bytearray (PEP 461), CPython 3.5
- annotated variables (PEP 526), CPython 3.6
- assignment expressions (PEP 572), CPython 3.8
Note that `basics/fun_code_full.py.exp` is added here because that requires
CPython 3.10 or newer.
Signed-off-by: Damien George <damien@micropython.org>
Prior to this commit, when unwinding through an active finally the stack
was not being correctly popped/folded, which resulting in the VM crashing
for complicated unwinding of nested finallys.
This should be fixed with this commit, and more tests for return/break/
continue within a finally have been added to exercise this.