Skip to content
Myr

Defer the trustme import until inside the fixture

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Move the trustme import from global scope into the nosan_server fixture in order to make it possible to deselect the test via command-line when trustme is not available.

authored by Michał Górny · committed by Michał Górny · parent 99b3b49 · Browse files · 1 file+4 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−1 removed

  • tests:+4 added−1 removed

1 file+4 added−1 removed

modified:tests/conftest.py+4 added-1 removed
11 unmodified lines
12import threading1314import pytest15from requests.compat import urljoin16import trustme161718def prepare_url(value):19 # Issue #1483: Make sure the URL always has a trailing slash
16 unmodified lines
363738@pytest.fixture39def nosan_server(tmp_path_factory):40 # delay importing until the fixture in order to make it possible41 # to deselect the test via command-line when trustme is not available42 import trustme4344 tmpdir = tmp_path_factory.mktemp("certs")45 ca = trustme.CA()46 # only commonName, no subjectAltName47 server_cert = ca.issue_cert(common_name=u"localhost")
14 unmodified lines