Skip to content

Commit e66a1a3

Browse files
committed
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>
1 parent 230bbbb commit e66a1a3

7 files changed

Lines changed: 134 additions & 0 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
1
2+
2
3+
5
4+
a 1
5+
1
6+
iter 0
7+
1
8+
None
9+
1
10+
2
11+
None
12+
1
13+
2
14+
None
15+
1
16+
3
17+
4
18+
7
19+
1
20+
2
21+
4
22+
7
23+
1
24+
4
25+
7
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
4 0 0 1
2+
4 0 0 2
3+
4 0 0 3
4+
4 0 0 4
5+
4 1 0 1
6+
4 1 0 2
7+
4 1 0 3
8+
4 1 0 4
9+
4 2 0 1
10+
4 2 0 2
11+
4 2 0 3
12+
4 2 0 4
13+
4 3 0 1
14+
4 3 0 2
15+
4 3 0 3
16+
4 3 0 4
17+
None
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
4 0
2+
continue
3+
4 1
4+
continue
5+
4 2
6+
continue
7+
4 3
8+
continue
9+
None
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
finally
2+
0
3+
finally 1
4+
finally 2
5+
2
6+
finally 1
7+
finally 2
8+
1
9+
finally 1
10+
finally 2
11+
2
12+
finally
13+
0
14+
finally
15+
0
16+
finally
17+
0
18+
finally
19+
0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
1
2+
42
3+
1
4+
2
5+
42
6+
1
7+
2
8+
3
9+
42
10+
2
11+
1
12+
42
13+
2
14+
1
15+
42
16+
1
17+
3
18+
2
19+
42
20+
1
21+
3
22+
2
23+
42
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
1
2+
2
3+
3
4+
4
5+
5
6+
None
7+
1
8+
2
9+
3
10+
5
11+
42
12+
1
13+
2
14+
5
15+
43
16+
1
17+
2
18+
5
19+
43
20+
1
21+
2
22+
5
23+
caught
24+
1
25+
2
26+
5
27+
caught
28+
1
29+
2
30+
3
31+
4
32+
5
33+
None
34+
1
35+
2
36+
3
37+
5
38+
42
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
4 0
2+
return
3+
43

0 commit comments

Comments
 (0)