aio-libs / aiohttp
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)
Files Coverage
aiohttp 97.21%
Project Totals (41 files) 97.21%
1
codecov:
2
  branch: master
3

4
coverage:
5
  range: "95..100"
6

7
  status:
8
    project: no
9

10
flags:
11
  library:
12
    paths:
13
    - aiohttp/
14
  configs:
15
    paths:
16
    - requirements/
17
    - ".git*"
18
    - "*.toml"
19
    - "*.yml"
20
  changelog:
21
    paths:
22
    - CHANGES/
23
    - CHANGES.rst
24
  docs:
25
    paths:
26
    - docs/
27
    - "*.md"
28
    - "*.rst"
29
    - "*.txt"
30
  tests:
31
    paths:
32
    - tests/
33
  tools:
34
    paths:
35
    - tools/
36
  third-party:
37
    paths:
38
    - vendor/
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading