From 965818b4c564b207d173b6b3aac7762bbae0c4cd Mon Sep 17 00:00:00 2001 From: Nati Dziubov Date: Thu, 8 Aug 2024 08:55:23 +0300 Subject: [PATCH] httpserver: Cleanup state in function scoped fixtures before the test --- pytest_httpserver/pytest_plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pytest_httpserver/pytest_plugin.py b/pytest_httpserver/pytest_plugin.py index a243a113..2b77385f 100644 --- a/pytest_httpserver/pytest_plugin.py +++ b/pytest_httpserver/pytest_plugin.py @@ -64,8 +64,8 @@ def pytest_sessionfinish(session, exitstatus): # noqa: ARG001 @pytest.fixture() def httpserver(make_httpserver): server = make_httpserver - yield server server.clear() + return server @pytest.fixture(scope="session") @@ -81,8 +81,8 @@ def make_httpserver_ipv4(httpserver_ssl_context): @pytest.fixture() def httpserver_ipv4(make_httpserver_ipv4): server = make_httpserver_ipv4 - yield server server.clear() + return server @pytest.fixture(scope="session") @@ -98,5 +98,5 @@ def make_httpserver_ipv6(httpserver_ssl_context): @pytest.fixture() def httpserver_ipv6(make_httpserver_ipv6): server = make_httpserver_ipv6 - yield server server.clear() + return server