aio-libs / aiohttp

Compare 3a10cb5 ... +0 ... 461bc4b

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.

Showing 1 of 2 files from the diff.

@@ -2,6 +2,7 @@
Loading
2 2
import contextlib
3 3
import inspect
4 4
import warnings
5 +
from typing import Any, Awaitable, Callable, Dict, Generator, Optional, Type, Union
5 6
6 7
import pytest
7 8
@@ -28,6 +29,8 @@
Loading
28 29
except ImportError:  # pragma: no cover
29 30
    tokio = None
30 31
32 +
AiohttpClient = Callable[[Union[Application, BaseTestServer]], Awaitable[TestClient]]
33 +
31 34
32 35
def pytest_addoption(parser):  # type: ignore[no-untyped-def]
33 36
    parser.addoption(
@@ -300,7 +303,7 @@
Loading
300 303
301 304
302 305
@pytest.fixture
303 -
def aiohttp_client_cls():  # type: ignore[no-untyped-def]
306 +
def aiohttp_client_cls() -> Type[TestClient]:
304 307
    """
305 308
    Client class to use in ``aiohttp_client`` factory.
306 309
@@ -327,7 +330,9 @@
Loading
327 330
328 331
329 332
@pytest.fixture
330 -
def aiohttp_client(loop, aiohttp_client_cls):  # type: ignore[no-untyped-def]
333 +
def aiohttp_client(
334 +
    loop: asyncio.AbstractEventLoop, aiohttp_client_cls: Type[TestClient]
335 +
) -> Generator[AiohttpClient, None, None]:
331 336
    """Factory to create a TestClient instance.
332 337
333 338
    aiohttp_client(app, **kwargs)
@@ -336,9 +341,12 @@
Loading
336 341
    """
337 342
    clients = []
338 343
339 -
    async def go(  # type: ignore[no-untyped-def]
340 -
        __param, *, server_kwargs=None, **kwargs
341 -
    ):
344 +
    async def go(
345 +
        __param: Union[Application, BaseTestServer],
346 +
        *,
347 +
        server_kwargs: Optional[Dict[str, Any]] = None,
348 +
        **kwargs: Any
349 +
    ) -> TestClient:
342 350
        if isinstance(__param, Application):
343 351
            server_kwargs = server_kwargs or {}
344 352
            server = TestServer(__param, **server_kwargs)

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
aiohttp +<.01% 97.21%
Project Totals (41 files) 97.21%
Loading