From df206ab633ef369c89d27321823daf140a5ff6f4 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 14 Jul 2013 11:23:52 -0500 Subject: [PATCH] Skip the openid tests if the openid module is not installed. This commit sponsored by Brandon Smith. Thank you! --- mediagoblin/tests/test_openid.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mediagoblin/tests/test_openid.py b/mediagoblin/tests/test_openid.py index bba46db8..23a2290e 100644 --- a/mediagoblin/tests/test_openid.py +++ b/mediagoblin/tests/test_openid.py @@ -13,12 +13,14 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . + import urlparse import pkg_resources import pytest import mock -from openid.consumer.consumer import SuccessResponse +openid_consumer = pytest.importorskip( + "openid.consumer.consumer") from mediagoblin import mg_globals from mediagoblin.db.base import Session @@ -27,7 +29,6 @@ from mediagoblin.plugins.openid.models import OpenIDUserURL from mediagoblin.tests.tools import get_app, fixture_add_user from mediagoblin.tools import template - # App with plugin enabled @pytest.fixture() def openid_plugin_app(request): @@ -41,7 +42,7 @@ def openid_plugin_app(request): class TestOpenIDPlugin(object): def _setup(self, openid_plugin_app, value=True, edit=False, delete=False): if value: - response = SuccessResponse(mock.Mock(), mock.Mock()) + response = openid_consumer.SuccessResponse(mock.Mock(), mock.Mock()) if edit or delete: response.identity_url = u'http://add.myopenid.com' else: -- 2.25.1