tests/basics: Provide .exp files for generator tests that fail PEP479.
PEP479 (see https://www.python.org/dev/peps/pep-0479/) prohibited raising StopIteration from within a generator (it is turned into a RuntimeError). This behaviour was introduced in Python 3.5 and in 3.7 was made compulsory. Until uPy implements PEP479, this patch adds .py.exp files for the relevant tests so they can be run under Python 3.7.
This commit is contained in:
parent
8f0147cf00
commit
764e65fb11
14
tests/basics/gen_yield_from.py.exp
Normal file
14
tests/basics/gen_yield_from.py.exp
Normal file
@ -0,0 +1,14 @@
|
||||
here1
|
||||
3
|
||||
here2
|
||||
[1, 2]
|
||||
here1
|
||||
None
|
||||
here2
|
||||
[1, 2]
|
||||
here1
|
||||
123
|
||||
here2
|
||||
[1, 2]
|
||||
444
|
||||
[0, 1, 2]
|
20
tests/basics/gen_yield_from_close.py.exp
Normal file
20
tests/basics/gen_yield_from_close.py.exp
Normal file
@ -0,0 +1,20 @@
|
||||
-1
|
||||
1
|
||||
StopIteration
|
||||
-1
|
||||
1
|
||||
2
|
||||
leaf caught GeneratorExit and swallowed it
|
||||
delegating caught GeneratorExit
|
||||
StopIteration
|
||||
-1
|
||||
1
|
||||
2
|
||||
leaf caught GeneratorExit and raised StopIteration instead
|
||||
delegating caught GeneratorExit
|
||||
StopIteration
|
||||
123
|
||||
RuntimeError
|
||||
0
|
||||
1
|
||||
close
|
6
tests/basics/gen_yield_from_throw.py.exp
Normal file
6
tests/basics/gen_yield_from_throw.py.exp
Normal file
@ -0,0 +1,6 @@
|
||||
1
|
||||
got ValueError from upstream!
|
||||
str1
|
||||
got TypeError from downstream!
|
||||
123
|
||||
got StopIteration from downstream!
|
10
tests/basics/generator_close.py.exp
Normal file
10
tests/basics/generator_close.py.exp
Normal file
@ -0,0 +1,10 @@
|
||||
None
|
||||
StopIteration
|
||||
1
|
||||
None
|
||||
StopIteration
|
||||
[1, 2]
|
||||
None
|
||||
StopIteration
|
||||
None
|
||||
ValueError
|
Loading…
Reference in New Issue
Block a user