summaryrefslogtreecommitdiffstats
path: root/test/modules/http2/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/modules/http2/conftest.py')
-rw-r--r--test/modules/http2/conftest.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/test/modules/http2/conftest.py b/test/modules/http2/conftest.py
index 363abae4c2..930cc0ac7c 100644
--- a/test/modules/http2/conftest.py
+++ b/test/modules/http2/conftest.py
@@ -2,9 +2,11 @@ import logging
import os
import pytest
+import sys
-from h2_certs import CertificateSpec, H2TestCA
-from h2_env import H2TestEnv
+sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
+
+from .env import H2TestEnv
def pytest_report_header(config, startdir):
@@ -25,7 +27,7 @@ def pytest_generate_tests(metafunc):
metafunc.parametrize('repeat', range(count))
-@pytest.fixture(scope="session")
+@pytest.fixture(scope="module")
def env(pytestconfig) -> H2TestEnv:
level = logging.INFO
console = logging.StreamHandler()
@@ -34,20 +36,12 @@ def env(pytestconfig) -> H2TestEnv:
logging.getLogger('').addHandler(console)
logging.getLogger('').setLevel(level=level)
env = H2TestEnv(pytestconfig=pytestconfig)
- cert_specs = [
- CertificateSpec(domains=env.domains, key_type='rsa4096'),
- CertificateSpec(domains=env.domains_noh2, key_type='rsa2048'),
- ]
- ca = H2TestCA.create_root(name=env.http_tld,
- store_dir=os.path.join(env.server_dir, 'ca'), key_type="rsa4096")
- ca.issue_certs(cert_specs)
- env.set_ca(ca)
env.apache_access_log_clear()
env.apache_error_log_clear()
return env
-@pytest.fixture(autouse=True, scope="session")
+@pytest.fixture(autouse=True, scope="module")
def _session_scope(env):
yield
assert env.apache_stop() == 0