From cf6033b423284da479cf32dbf16878ef6b2ac6fe Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 30 Jan 2017 11:40:45 -0500 Subject: [PATCH] Move http_client fixture to root-level conftest --- conftest.py | 12 ++++++++++++ oauth/test/test_oidc.py | 10 ---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 000000000..b2488d926 --- /dev/null +++ b/conftest.py @@ -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 diff --git a/oauth/test/test_oidc.py b/oauth/test/test_oidc.py index e8bdd0c0e..4f15bfe0d 100644 --- a/oauth/test/test_oidc.py +++ b/oauth/test/test_oidc.py @@ -6,7 +6,6 @@ import urlparse import jwt import pytest -import requests from httmock import urlmatch, HTTMock from Crypto.PublicKey import RSA @@ -14,15 +13,6 @@ from jwkest.jwk import RSAKey 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]) def app_config(http_client, request): return {