Files
apache_httpd/test/conftest.py
Stefan Eissing fd47fda1a1 *) 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
2022-03-25 13:44:41 +00:00

25 lines
742 B
Python

import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
from pyhttpd.env import HttpdTestEnv
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))