Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 692874c

Browse filesBrowse files
[3.13] gh-119897: Add test for lambda generator invocation (GH-120658) (#120673)
gh-119897: Add test for lambda generator invocation (GH-120658) (cherry picked from commit 73dc1c6) gh-120467: Add test for lambda generator invocation Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
1 parent 451cb71 commit 692874c
Copy full SHA for 692874c

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎Lib/test/test_generators.py

Copy file name to clipboardExpand all lines: Lib/test/test_generators.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import unittest
77
import weakref
88
import inspect
9+
import types
910

1011
from test import support
1112

@@ -89,9 +90,12 @@ def gen():
8990
self.assertEqual(gc.garbage, old_garbage)
9091

9192
def test_lambda_generator(self):
92-
# Issue #23192: Test that a lambda returning a generator behaves
93+
# bpo-23192, gh-119897: Test that a lambda returning a generator behaves
9394
# like the equivalent function
9495
f = lambda: (yield 1)
96+
self.assertIsInstance(f(), types.GeneratorType)
97+
self.assertEqual(next(f()), 1)
98+
9599
def g(): return (yield 1)
96100

97101
# test 'yield from'

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.