mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[3.13] gh-132396: Resolve 'redefinition of unused name' errors in `Lib/test/
` (GH-132397) (#132699)
gh-132396: Resolve 'redefinition of unused name' errors in ``Lib/test/`` (GH-132397)
(cherry picked from commit 1d5dc5f1c3
)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
151828d520
commit
10f37b36b4
9 changed files with 22 additions and 26 deletions
|
@ -896,6 +896,7 @@ class TestPEP380Operation(unittest.TestCase):
|
|||
yield 2
|
||||
g1 = one()
|
||||
self.assertEqual(list(g1), [0, 1, 2, 3])
|
||||
|
||||
# Check with send
|
||||
g1 = one()
|
||||
res = [next(g1)]
|
||||
|
@ -905,6 +906,8 @@ class TestPEP380Operation(unittest.TestCase):
|
|||
except StopIteration:
|
||||
pass
|
||||
self.assertEqual(res, [0, 1, 2, 3])
|
||||
|
||||
def test_delegating_generators_claim_to_be_running_with_throw(self):
|
||||
# Check with throw
|
||||
class MyErr(Exception):
|
||||
pass
|
||||
|
@ -941,8 +944,10 @@ class TestPEP380Operation(unittest.TestCase):
|
|||
except:
|
||||
self.assertEqual(res, [0, 1, 2, 3])
|
||||
raise
|
||||
|
||||
def test_delegating_generators_claim_to_be_running_with_close(self):
|
||||
# Check with close
|
||||
class MyIt(object):
|
||||
class MyIt:
|
||||
def __iter__(self):
|
||||
return self
|
||||
def __next__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue