Bump ruff to 0.8.0 (#131273)
This commit is contained in:
@@ -510,30 +510,31 @@ def aiohttp_client(
|
||||
clients = []
|
||||
|
||||
async def go(
|
||||
__param: Application | BaseTestServer,
|
||||
param: Application | BaseTestServer,
|
||||
/,
|
||||
*args: Any,
|
||||
server_kwargs: dict[str, Any] | None = None,
|
||||
**kwargs: Any,
|
||||
) -> TestClient:
|
||||
if isinstance(__param, Callable) and not isinstance( # type: ignore[arg-type]
|
||||
__param, (Application, BaseTestServer)
|
||||
if isinstance(param, Callable) and not isinstance( # type: ignore[arg-type]
|
||||
param, (Application, BaseTestServer)
|
||||
):
|
||||
__param = __param(loop, *args, **kwargs)
|
||||
param = param(loop, *args, **kwargs)
|
||||
kwargs = {}
|
||||
else:
|
||||
assert not args, "args should be empty"
|
||||
|
||||
client: TestClient
|
||||
if isinstance(__param, Application):
|
||||
if isinstance(param, Application):
|
||||
server_kwargs = server_kwargs or {}
|
||||
server = TestServer(__param, loop=loop, **server_kwargs)
|
||||
server = TestServer(param, loop=loop, **server_kwargs)
|
||||
# Registering a view after starting the server should still work.
|
||||
server.app._router.freeze = lambda: None
|
||||
client = CoalescingClient(server, loop=loop, **kwargs)
|
||||
elif isinstance(__param, BaseTestServer):
|
||||
client = TestClient(__param, loop=loop, **kwargs)
|
||||
elif isinstance(param, BaseTestServer):
|
||||
client = TestClient(param, loop=loop, **kwargs)
|
||||
else:
|
||||
raise TypeError(f"Unknown argument type: {type(__param)!r}")
|
||||
raise TypeError(f"Unknown argument type: {type(param)!r}")
|
||||
|
||||
await client.start_server()
|
||||
clients.append(client)
|
||||
|
||||
Reference in New Issue
Block a user