Move http_client fixture to root-level conftest

This commit is contained in:
Joseph Schorr 2017-01-30 11:40:45 -05:00
parent c9812864be
commit cf6033b423
2 changed files with 12 additions and 10 deletions

12
conftest.py Normal file
View file

@ -0,0 +1,12 @@
import pytest
import requests
@pytest.fixture()
def http_client():
sess = requests.Session()
adapter = requests.adapters.HTTPAdapter(pool_connections=100,
pool_maxsize=100)
sess.mount('http://', adapter)
sess.mount('https://', adapter)
return sess

View file

@ -6,7 +6,6 @@ import urlparse
import jwt import jwt
import pytest import pytest
import requests
from httmock import urlmatch, HTTMock from httmock import urlmatch, HTTMock
from Crypto.PublicKey import RSA from Crypto.PublicKey import RSA
@ -14,15 +13,6 @@ from jwkest.jwk import RSAKey
from oauth.oidc import OIDCLoginService, OAuthLoginException from oauth.oidc import OIDCLoginService, OAuthLoginException
@pytest.fixture()
def http_client():
sess = requests.Session()
adapter = requests.adapters.HTTPAdapter(pool_connections=100,
pool_maxsize=100)
sess.mount('http://', adapter)
sess.mount('https://', adapter)
return sess
@pytest.fixture(params=[True, False]) @pytest.fixture(params=[True, False])
def app_config(http_client, request): def app_config(http_client, request):
return { return {