🐛 Bug: 添加 HTTP 客户端会话上下文检查 (#2632)

This commit is contained in:
Ju4tCode
2024-04-08 20:17:03 +08:00
committed by GitHub
parent 7a232c7a4a
commit 9b4b1526b1
3 changed files with 9 additions and 0 deletions

View File

@ -328,6 +328,11 @@ async def test_http_client_session(driver: Driver, server_url: URL):
with pytest.raises(RuntimeError):
await session.request(request)
with pytest.raises(RuntimeError): # noqa: PT012
async with session:
async with session:
...
async with session as session:
# simple post with query, headers, cookies and content
request = Request(