pytest: improvements for suitable curl and error output

- will check built curl for http and https support and
  skip all tests if not there
- will dump stdout/stderr/trace output on errored responses

Closes #10829
This commit is contained in:
Stefan Eissing 2023-03-24 13:09:40 +01:00 committed by Daniel Stenberg
parent 8455013359
commit 8cabef6fc3
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
16 changed files with 131 additions and 106 deletions

View file

@ -39,6 +39,13 @@ def env(pytestconfig) -> Env:
env = Env(pytestconfig=pytestconfig)
level = logging.DEBUG if env.verbose > 0 else logging.INFO
logging.getLogger('').setLevel(level=level)
if not env.curl_has_protocol('http'):
pytest.skip("curl built without HTTP support")
if not env.curl_has_protocol('https'):
pytest.skip("curl built without HTTPS support")
if env.setup_incomplete():
pytest.skip(env.incomplete_reason())
env.setup()
return env