[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:
Miss Islington (bot) 2025-04-18 21:35:35 +02:00 committed by GitHub
parent 151828d520
commit 10f37b36b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 22 additions and 26 deletions

View file

@ -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):