Fix the wall-clock timeout tests on Python 3.10 (#7488)
Both tests remove asyncio.timeout to exercise the fallback path in _wall_clock_timeout. On Python 3.10 that attribute does not exist in the first place, so monkeypatch.delattr raises AttributeError and Backend CI fails on its 3.10 leg. raising=False keeps the intent, the attribute is absent either way.
This commit is contained in:
parent
cd5011f288
commit
4a79d707c5
1 changed files with 6 additions and 2 deletions
|
|
@ -861,7 +861,9 @@ def test_stream_completion_timeout_is_absolute_despite_keepalives(monkeypatch):
|
|||
|
||||
|
||||
def test_wall_clock_timeout_supports_python_without_asyncio_timeout(monkeypatch):
|
||||
monkeypatch.delattr(research_runs.asyncio, "timeout")
|
||||
# raising=False: on Python 3.10 asyncio.timeout does not exist to begin with,
|
||||
# which is the very case these tests cover.
|
||||
monkeypatch.delattr(research_runs.asyncio, "timeout", raising = False)
|
||||
|
||||
async def run():
|
||||
async with research_runs._wall_clock_timeout(0.01):
|
||||
|
|
@ -872,7 +874,9 @@ def test_wall_clock_timeout_supports_python_without_asyncio_timeout(monkeypatch)
|
|||
|
||||
|
||||
def test_wall_clock_timeout_does_not_swallow_shutdown_cancellation(monkeypatch):
|
||||
monkeypatch.delattr(research_runs.asyncio, "timeout")
|
||||
# raising=False: on Python 3.10 asyncio.timeout does not exist to begin with,
|
||||
# which is the very case these tests cover.
|
||||
monkeypatch.delattr(research_runs.asyncio, "timeout", raising = False)
|
||||
|
||||
async def run(cleanup_started: asyncio.Event):
|
||||
async with research_runs._wall_clock_timeout(0.01):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue