From fc3df514e81de8ff14d9ef43ee53caab408a50ee Mon Sep 17 00:00:00 2001 From: Florimond Manca Date: Sun, 6 Oct 2019 02:12:06 +0200 Subject: [PATCH] Don't check trio import in definition of backend fixture params (#447) --- tests/conftest.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index ed9ea34b..c6968894 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -18,6 +18,7 @@ from uvicorn.config import Config from uvicorn.main import Server from httpx import URL, AsyncioBackend +from httpx.concurrency.trio import TrioBackend ENVIRONMENT_VARIABLES = { "SSL_CERT_FILE", @@ -47,17 +48,12 @@ def clean_environ() -> typing.Dict[str, typing.Any]: os.environ.update(original_environ) -backend_params = [pytest.param(AsyncioBackend, marks=pytest.mark.asyncio)] - -try: - from httpx.concurrency.trio import TrioBackend -except ImportError: # pragma: no cover - pass -else: - backend_params.append(pytest.param(TrioBackend, marks=pytest.mark.trio)) - - -@pytest.fixture(params=backend_params) +@pytest.fixture( + params=[ + pytest.param(AsyncioBackend, marks=pytest.mark.asyncio), + pytest.param(TrioBackend, marks=pytest.mark.trio), + ] +) def backend(request): backend_cls = request.param return backend_cls() -- 2.47.3