]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-129354: Cleanup test_coroutines (#129684)
authorVictor Stinner <vstinner@python.org>
Wed, 5 Feb 2025 11:43:46 +0000 (12:43 +0100)
committerGitHub <noreply@github.com>
Wed, 5 Feb 2025 11:43:46 +0000 (11:43 +0000)
Remove unused variables.

Lib/test/test_coroutines.py

index 5566c9803d43ed10ce2494a127095e4d2e21982d..ae3cd3555002ef79a0013d230b92f35d888fedc0 100644 (file)
@@ -735,7 +735,7 @@ class CoroutineTest(unittest.TestCase):
 
     def test_func_12(self):
         async def g():
-            i = me.send(None)
+            me.send(None)
             await foo
         me = g()
         with self.assertRaisesRegex(ValueError,
@@ -2283,7 +2283,7 @@ class CoroAsyncIOCompatTest(unittest.TestCase):
                 buffer.append(exc_type.__name__)
 
         async def f():
-            async with CM() as c:
+            async with CM():
                 await asyncio.sleep(0.01)
                 raise MyException
             buffer.append('unreachable')
@@ -2375,7 +2375,7 @@ class OriginTrackingTest(unittest.TestCase):
 
         orig_depth = sys.get_coroutine_origin_tracking_depth()
         try:
-            msg = check(0, f"coroutine '{corofn.__qualname__}' was never awaited")
+            check(0, f"coroutine '{corofn.__qualname__}' was never awaited")
             check(1, "".join([
                 f"coroutine '{corofn.__qualname__}' was never awaited\n",
                 "Coroutine created at (most recent call last)\n",
@@ -2413,7 +2413,6 @@ class OriginTrackingTest(unittest.TestCase):
                 coro_repr = repr(coro)
 
                 # clear reference to the coroutine without awaiting for it
-                coro_repr = repr(coro)
                 del coro
                 support.gc_collect()