From: Rainer Jung Date: Mon, 15 Jul 2024 22:42:20 +0000 (+0000) Subject: Make sure pytest shuts down the web server after each package. X-Git-Tag: 2.4.63-candidate~173 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd2255e5cad9aa2e09d89dda00adaa6db2511799;p=thirdparty%2Fapache%2Fhttpd.git Make sure pytest shuts down the web server after each package. Backport of r1919265 from trunk. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1919267 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/modules/core/conftest.py b/test/modules/core/conftest.py index 22906efbb04..a14bdfb6752 100644 --- a/test/modules/core/conftest.py +++ b/test/modules/core/conftest.py @@ -28,3 +28,8 @@ def env(pytestconfig) -> CoreTestEnv: env.apache_access_log_clear() env.httpd_error_log.clear_log() return env + +@pytest.fixture(autouse=True, scope="package") +def _stop_package_scope(env): + yield + assert env.apache_stop() == 0 diff --git a/test/modules/http1/conftest.py b/test/modules/http1/conftest.py index 33a16a11704..45b26c1796f 100644 --- a/test/modules/http1/conftest.py +++ b/test/modules/http1/conftest.py @@ -34,3 +34,8 @@ def env(pytestconfig) -> H1TestEnv: env.apache_access_log_clear() env.httpd_error_log.clear_log() return env + +@pytest.fixture(autouse=True, scope="package") +def _stop_package_scope(env): + yield + assert env.apache_stop() == 0 diff --git a/test/modules/md/conftest.py b/test/modules/md/conftest.py index 0f9e4a9f490..a7b064b6a98 100755 --- a/test/modules/md/conftest.py +++ b/test/modules/md/conftest.py @@ -59,3 +59,7 @@ def acme(env): if acme_server is not None: acme_server.stop() +@pytest.fixture(autouse=True, scope="package") +def _stop_package_scope(env): + yield + assert env.apache_stop() == 0 diff --git a/test/modules/proxy/conftest.py b/test/modules/proxy/conftest.py index 7e6f4e7b09d..c92e363e2a5 100644 --- a/test/modules/proxy/conftest.py +++ b/test/modules/proxy/conftest.py @@ -29,3 +29,8 @@ def env(pytestconfig) -> ProxyTestEnv: env.apache_access_log_clear() env.httpd_error_log.clear_log() return env + +@pytest.fixture(autouse=True, scope="package") +def _stop_package_scope(env): + yield + assert env.apache_stop() == 0 diff --git a/test/modules/tls/conftest.py b/test/modules/tls/conftest.py index c7cb85877d5..6f6f983cfd4 100644 --- a/test/modules/tls/conftest.py +++ b/test/modules/tls/conftest.py @@ -31,3 +31,8 @@ def env(pytestconfig) -> TlsTestEnv: env.apache_access_log_clear() env.httpd_error_log.clear_log() return env + +@pytest.fixture(autouse=True, scope="package") +def _stop_package_scope(env): + yield + assert env.apache_stop() == 0