From b06d73bfc8f2a54149b95d38499d72c328588546 Mon Sep 17 00:00:00 2001 From: Danny McClanahan <1305167+cosmicexplorer@users.noreply.github.com> Date: Sun, 11 Aug 2024 06:13:17 -0400 Subject: [PATCH] scope mock server fixture to session scope --- tests/conftest.py | 2 +- tests/unit/test_network_lazy_wheel.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index d3388dd0594..4cb8154fad2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -723,7 +723,7 @@ def factory() -> str: return factory -@pytest.fixture +@pytest.fixture(scope="session") def mock_server() -> Iterator[MockServer]: server = make_mock_server() test_server = MockServer(server) diff --git a/tests/unit/test_network_lazy_wheel.py b/tests/unit/test_network_lazy_wheel.py index 356387d2bba..1a6f6686e15 100644 --- a/tests/unit/test_network_lazy_wheel.py +++ b/tests/unit/test_network_lazy_wheel.py @@ -25,12 +25,12 @@ } -@pytest.fixture +@pytest.fixture(scope="session") def session() -> PipSession: return PipSession() -@pytest.fixture +@pytest.fixture(scope="session") def mypy_whl_no_range(mock_server: MockServer, shared_data: TestData) -> Iterator[str]: mypy_whl = shared_data.packages / "mypy-0.782-py3-none-any.whl" mock_server.set_responses([file_response(mypy_whl)])