From: Stefan Eissing Date: Fri, 25 Mar 2022 13:44:41 +0000 (+0000) Subject: *) test: making pytest option --repeat global as otherwise X-Git-Tag: 2.5.0-alpha2-ci-test-only~434 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd47fda1a1b62024a37197c7906fa2ed1d2f710a;p=thirdparty%2Fapache%2Fhttpd.git *) test: making pytest option --repeat global as otherwise there are conflicts when individual modules add that. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899198 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/conftest.py b/test/conftest.py index a5c7c6bffb0..3472e969f2c 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -9,4 +9,16 @@ def pytest_report_header(config, startdir): env = HttpdTestEnv() return f"[apache httpd: {env.get_httpd_version()}, mpm: {env.mpm_module}, {env.prefix}]" +def pytest_addoption(parser): + parser.addoption("--repeat", action="store", type=int, default=1, + help='Number of times to repeat each test') + parser.addoption("--all", action="store_true") + + +def pytest_generate_tests(metafunc): + if "repeat" in metafunc.fixturenames: + count = int(metafunc.config.getoption("repeat")) + metafunc.fixturenames.append('tmp_ct') + metafunc.parametrize('repeat', range(count)) + diff --git a/test/modules/http2/conftest.py b/test/modules/http2/conftest.py index 806777439ea..55d0c3a21e3 100644 --- a/test/modules/http2/conftest.py +++ b/test/modules/http2/conftest.py @@ -14,19 +14,6 @@ def pytest_report_header(config, startdir): return f"mod_h2 [apache: {env.get_httpd_version()}, mpm: {env.mpm_module}, {env.prefix}]" -def pytest_addoption(parser): - parser.addoption("--repeat", action="store", type=int, default=1, - help='Number of times to repeat each test') - parser.addoption("--all", action="store_true") - - -def pytest_generate_tests(metafunc): - if "repeat" in metafunc.fixturenames: - count = int(metafunc.config.getoption("repeat")) - metafunc.fixturenames.append('tmp_ct') - metafunc.parametrize('repeat', range(count)) - - @pytest.fixture(scope="package") def env(pytestconfig) -> H2TestEnv: level = logging.INFO diff --git a/test/modules/tls/conftest.py b/test/modules/tls/conftest.py index 9580307dfdc..cde4be60714 100644 --- a/test/modules/tls/conftest.py +++ b/test/modules/tls/conftest.py @@ -18,19 +18,6 @@ def pytest_report_header(config, startdir): ) -def pytest_addoption(parser): - parser.addoption("--repeat", action="store", type=int, default=1, - help='Number of times to repeat each test') - parser.addoption("--all", action="store_true") - - -def pytest_generate_tests(metafunc): - if "repeat" in metafunc.fixturenames: - count = int(metafunc.config.getoption("repeat")) - metafunc.fixturenames.append('tmp_ct') - metafunc.parametrize('repeat', range(count)) - - @pytest.fixture(scope="package") def env(pytestconfig) -> TlsTestEnv: level = logging.INFO