httpie-cli/tests/conftest.py
Jakub Roztocil a6ebc44a48 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.
2016-03-06 17:42:35 +08:00

15 lines
413 B
Python

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