summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/basics/gen_yield_from.py.exp14
-rw-r--r--tests/basics/gen_yield_from_close.py.exp20
-rw-r--r--tests/basics/gen_yield_from_throw.py.exp6
-rw-r--r--tests/basics/generator_close.py.exp10
4 files changed, 50 insertions, 0 deletions
diff --git a/tests/basics/gen_yield_from.py.exp b/tests/basics/gen_yield_from.py.exp
new file mode 100644
index 000000000..507f2b9ca
--- /dev/null
+++ b/tests/basics/gen_yield_from.py.exp
@@ -0,0 +1,14 @@
+here1
+3
+here2
+[1, 2]
+here1
+None
+here2
+[1, 2]
+here1
+123
+here2
+[1, 2]
+444
+[0, 1, 2]
diff --git a/tests/basics/gen_yield_from_close.py.exp b/tests/basics/gen_yield_from_close.py.exp
new file mode 100644
index 000000000..a44d1353d
--- /dev/null
+++ b/tests/basics/gen_yield_from_close.py.exp
@@ -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
diff --git a/tests/basics/gen_yield_from_throw.py.exp b/tests/basics/gen_yield_from_throw.py.exp
new file mode 100644
index 000000000..6ce97ad86
--- /dev/null
+++ b/tests/basics/gen_yield_from_throw.py.exp
@@ -0,0 +1,6 @@
+1
+got ValueError from upstream!
+str1
+got TypeError from downstream!
+123
+got StopIteration from downstream!
diff --git a/tests/basics/generator_close.py.exp b/tests/basics/generator_close.py.exp
new file mode 100644
index 000000000..fcd583935
--- /dev/null
+++ b/tests/basics/generator_close.py.exp
@@ -0,0 +1,10 @@
+None
+StopIteration
+1
+None
+StopIteration
+[1, 2]
+None
+StopIteration
+None
+ValueError