mirror of
https://github.com/micropython/micropython.git
synced 2026-01-28 06:40:19 +01:00
tests/basics/try_finally: Fix try/finally flow tests under CPython 3.14.
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>
This commit is contained in:
25
tests/basics/try_finally_break.py.exp
Normal file
25
tests/basics/try_finally_break.py.exp
Normal file
@@ -0,0 +1,25 @@
|
||||
1
|
||||
2
|
||||
5
|
||||
a 1
|
||||
1
|
||||
iter 0
|
||||
1
|
||||
None
|
||||
1
|
||||
2
|
||||
None
|
||||
1
|
||||
2
|
||||
None
|
||||
1
|
||||
3
|
||||
4
|
||||
7
|
||||
1
|
||||
2
|
||||
4
|
||||
7
|
||||
1
|
||||
4
|
||||
7
|
||||
17
tests/basics/try_finally_break2.py.exp
Normal file
17
tests/basics/try_finally_break2.py.exp
Normal file
@@ -0,0 +1,17 @@
|
||||
4 0 0 1
|
||||
4 0 0 2
|
||||
4 0 0 3
|
||||
4 0 0 4
|
||||
4 1 0 1
|
||||
4 1 0 2
|
||||
4 1 0 3
|
||||
4 1 0 4
|
||||
4 2 0 1
|
||||
4 2 0 2
|
||||
4 2 0 3
|
||||
4 2 0 4
|
||||
4 3 0 1
|
||||
4 3 0 2
|
||||
4 3 0 3
|
||||
4 3 0 4
|
||||
None
|
||||
9
tests/basics/try_finally_continue.py.exp
Normal file
9
tests/basics/try_finally_continue.py.exp
Normal file
@@ -0,0 +1,9 @@
|
||||
4 0
|
||||
continue
|
||||
4 1
|
||||
continue
|
||||
4 2
|
||||
continue
|
||||
4 3
|
||||
continue
|
||||
None
|
||||
19
tests/basics/try_finally_return2.py.exp
Normal file
19
tests/basics/try_finally_return2.py.exp
Normal file
@@ -0,0 +1,19 @@
|
||||
finally
|
||||
0
|
||||
finally 1
|
||||
finally 2
|
||||
2
|
||||
finally 1
|
||||
finally 2
|
||||
1
|
||||
finally 1
|
||||
finally 2
|
||||
2
|
||||
finally
|
||||
0
|
||||
finally
|
||||
0
|
||||
finally
|
||||
0
|
||||
finally
|
||||
0
|
||||
23
tests/basics/try_finally_return3.py.exp
Normal file
23
tests/basics/try_finally_return3.py.exp
Normal file
@@ -0,0 +1,23 @@
|
||||
1
|
||||
42
|
||||
1
|
||||
2
|
||||
42
|
||||
1
|
||||
2
|
||||
3
|
||||
42
|
||||
2
|
||||
1
|
||||
42
|
||||
2
|
||||
1
|
||||
42
|
||||
1
|
||||
3
|
||||
2
|
||||
42
|
||||
1
|
||||
3
|
||||
2
|
||||
42
|
||||
38
tests/basics/try_finally_return4.py.exp
Normal file
38
tests/basics/try_finally_return4.py.exp
Normal file
@@ -0,0 +1,38 @@
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
None
|
||||
1
|
||||
2
|
||||
3
|
||||
5
|
||||
42
|
||||
1
|
||||
2
|
||||
5
|
||||
43
|
||||
1
|
||||
2
|
||||
5
|
||||
43
|
||||
1
|
||||
2
|
||||
5
|
||||
caught
|
||||
1
|
||||
2
|
||||
5
|
||||
caught
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
None
|
||||
1
|
||||
2
|
||||
3
|
||||
5
|
||||
42
|
||||
3
tests/basics/try_finally_return5.py.exp
Normal file
3
tests/basics/try_finally_return5.py.exp
Normal file
@@ -0,0 +1,3 @@
|
||||
4 0
|
||||
return
|
||||
43
|
||||
Reference in New Issue
Block a user