mirror of
https://github.com/curl/curl.git
synced 2026-08-26 02:53:30 +03:00
tests: use dynamic ports numbers in pytest suite
- necessary ports are bound at start of test suite and then given to server fixtures for use. - this make parallel use of pytest (in separate directories), practically safe for use as OS tend to not reuse such port numbers for a while Closes #10692
This commit is contained in:
parent
257416023d
commit
b0564c1d54
6 changed files with 118 additions and 39 deletions
|
|
@ -34,10 +34,6 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
|
|||
from testenv import Env, Nghttpx, Httpd
|
||||
|
||||
|
||||
def pytest_report_header(config, startdir):
|
||||
return f"curl http tests"
|
||||
|
||||
|
||||
@pytest.fixture(scope="package")
|
||||
def env(pytestconfig) -> Env:
|
||||
env = Env(pytestconfig=pytestconfig)
|
||||
|
|
@ -46,6 +42,10 @@ def env(pytestconfig) -> Env:
|
|||
env.setup()
|
||||
return env
|
||||
|
||||
@pytest.fixture(scope="package", autouse=True)
|
||||
def log_global_env_facts(record_testsuite_property, env):
|
||||
record_testsuite_property("http-port", env.http_port)
|
||||
|
||||
|
||||
@pytest.fixture(scope='package')
|
||||
def httpd(env) -> Httpd:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue