Skip to content

Commit 55d14d0

Browse files
committed
Fix debug print and tweak asyncio skip filter
1 parent 7a0f120 commit 55d14d0

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

tests/test_aiohttp.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ async def stop():
117117
self.loop.run_until_complete(stop())
118118

119119
def test_aiohttp_connection_lost_when_busy(self):
120-
if self.implementation == 'asyncio':
121-
raise unittest.SkipTest('bug in asyncio #118950 tests in CPython.')
120+
if self.implementation == 'asyncio' and sys.version_info < (3, 13):
121+
raise unittest.SkipTest(
122+
"asyncio bug #118950, fixed in CPython 3.13+"
123+
)
122124

123125
cert = tb._cert_fullname(__file__, 'ssl_cert.pem')
124126
key = tb._cert_fullname(__file__, 'ssl_key.pem')
@@ -131,8 +133,8 @@ def test_aiohttp_connection_lost_when_busy(self):
131133
async def handler(request):
132134
ws = aiohttp.web.WebSocketResponse()
133135
await ws.prepare(request)
134-
async for msg in ws:
135-
print("Received:", msg.data)
136+
async for _msg in ws:
137+
pass
136138
return ws
137139

138140
app.router.add_get('/', handler)

tests/test_tcp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3315,8 +3315,10 @@ async def run_main():
33153315
self.loop.run_until_complete(run_main())
33163316

33173317
def test_connection_lost_when_busy(self):
3318-
if self.implementation == 'asyncio':
3319-
raise unittest.SkipTest('bug in asyncio #118950 tests in CPython.')
3318+
if self.implementation == 'asyncio' and sys.version_info < (3, 13):
3319+
raise unittest.SkipTest(
3320+
"asyncio bug #118950, fixed in CPython 3.13+"
3321+
)
33203322

33213323
ssl_context = self._create_server_ssl_context(
33223324
self.ONLYCERT, self.ONLYKEY)

0 commit comments

Comments
 (0)