Run tests against both HTTP and HTTPS

Some of the tests now use the `httpbin_both` fixture from pytest-httpbin.
Also, made httpbin's CA trusted by default and added `httpbin_secure_untrusted`
fixture  to allow overriding that for particular tests.
This commit is contained in:
Jakub Roztocil
2016-03-06 17:42:35 +08:00
parent 5e03aeceb7
commit a6ebc44a48
6 changed files with 58 additions and 50 deletions

14
tests/conftest.py Normal file
View File

@ -0,0 +1,14 @@
import pytest
from pytest_httpbin.plugin import httpbin_ca_bundle
# Make httpbin's CA trusted by default
pytest.fixture(autouse=True)(httpbin_ca_bundle)
@pytest.fixture(scope='function')
def httpbin_secure_untrusted(monkeypatch, httpbin_secure):
"""Like the `httpbin_secure` fixture, but without the
make-CA-trusted-by-default"""
monkeypatch.delenv('REQUESTS_CA_BUNDLE')
return httpbin_secure