-
-
Notifications
You must be signed in to change notification settings - Fork 953
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
693 additions
and
854 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,10 @@ | ||
from __future__ import annotations | ||
|
||
import functools | ||
from typing import Any, Literal | ||
from typing import Literal | ||
|
||
import pytest | ||
|
||
from starlette.testclient import TestClient | ||
from tests.types import TestClientFactory | ||
|
||
|
||
@pytest.fixture | ||
def test_client_factory( | ||
anyio_backend_name: Literal["asyncio", "trio"], | ||
anyio_backend_options: dict[str, Any], | ||
) -> TestClientFactory: | ||
# anyio_backend_name defined by: | ||
# https://anyio.readthedocs.io/en/stable/testing.html#specifying-the-backends-to-run-on | ||
return functools.partial( | ||
TestClient, | ||
backend=anyio_backend_name, | ||
backend_options=anyio_backend_options, | ||
) | ||
def anyio_backend() -> Literal["asyncio"]: | ||
return "asyncio" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.