mirror of
https://github.com/httpie/cli.git
synced 2025-06-27 04:51:28 +02:00
Fix pytest configuration
This commit is contained in:
parent
137889a267
commit
749b1e2aca
@ -1,14 +1,24 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from pytest_httpbin.plugin import httpbin_ca_bundle
|
from pytest_httpbin import certs
|
||||||
|
|
||||||
|
|
||||||
# Make httpbin's CA trusted by default
|
@pytest.fixture(scope='function', autouse=True)
|
||||||
pytest.fixture(autouse=True)(httpbin_ca_bundle)
|
def httpbin_add_ca_bundle(monkeypatch):
|
||||||
|
"""
|
||||||
|
Make pytest-httpbin's CA trusted by default.
|
||||||
|
|
||||||
|
(Same as `httpbin_ca_bundle`, just auto-used.).
|
||||||
|
|
||||||
|
"""
|
||||||
|
monkeypatch.setenv('REQUESTS_CA_BUNDLE', certs.where())
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='function')
|
@pytest.fixture(scope='function')
|
||||||
def httpbin_secure_untrusted(monkeypatch, httpbin_secure):
|
def httpbin_secure_untrusted(monkeypatch, httpbin_secure):
|
||||||
"""Like the `httpbin_secure` fixture, but without the
|
"""
|
||||||
make-CA-trusted-by-default"""
|
Like the `httpbin_secure` fixture, but without the
|
||||||
|
make-CA-trusted-by-default.
|
||||||
|
|
||||||
|
"""
|
||||||
monkeypatch.delenv('REQUESTS_CA_BUNDLE')
|
monkeypatch.delenv('REQUESTS_CA_BUNDLE')
|
||||||
return httpbin_secure
|
return httpbin_secure
|
||||||
|
Loading…
x
Reference in New Issue
Block a user