From 3593a64ed6755876702ce362e1dfc87849c0952b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 4 Jan 2015 12:09:27 -0500 Subject: Skip integration tests when one of the packages under test is already installed, as the installation will fail in that case. --- setuptools/tests/test_integration.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'setuptools/tests/test_integration.py') diff --git a/setuptools/tests/test_integration.py b/setuptools/tests/test_integration.py index 3a6abeaa..92a27080 100644 --- a/setuptools/tests/test_integration.py +++ b/setuptools/tests/test_integration.py @@ -14,6 +14,17 @@ from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution +def setup_module(module): + packages = 'stevedore', 'virtualenvwrapper', 'pbr', 'novaclient' + for pkg in packages: + try: + __import__(pkg) + tmpl = "Integration tests cannot run when {pkg} is installed" + pytest.skip(tmpl.format(**locals())) + except ImportError: + pass + + @pytest.fixture def install_context(request, tmpdir, monkeypatch): """Fixture to set up temporary installation directory. -- cgit v1.2.1 From 1cd6c9a1f6840ff82217a9e7059b8ec7049f3a32 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 15 Jan 2015 19:41:04 -0500 Subject: Skip integration tests when SSL is broken. Ref #317. --- setuptools/tests/test_integration.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'setuptools/tests/test_integration.py') diff --git a/setuptools/tests/test_integration.py b/setuptools/tests/test_integration.py index 92a27080..90bb4313 100644 --- a/setuptools/tests/test_integration.py +++ b/setuptools/tests/test_integration.py @@ -12,6 +12,7 @@ import pytest from setuptools.command.easy_install import easy_install from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution +from setuptools.compat import urlopen def setup_module(module): @@ -24,6 +25,11 @@ def setup_module(module): except ImportError: pass + try: + urlopen('https://pypi.python.org/pypi') + except Exception as exc: + pytest.skip(reason=str(exc)) + @pytest.fixture def install_context(request, tmpdir, monkeypatch): -- cgit v1.2.1 From 82d003629ef23fd7f0dc2fb71d5edc937271ffd8 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Sun, 5 Apr 2015 08:39:18 +0200 Subject: Fix TypeError for pytest.skip() pytests skip() method doesn't have a 'reason' parameter. This fixes: TypeError: skip() got an unexpected keyword argument 'reason' --HG-- branch : fix-type-error-skip-reason --- setuptools/tests/test_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/tests/test_integration.py') diff --git a/setuptools/tests/test_integration.py b/setuptools/tests/test_integration.py index 90bb4313..07f06db2 100644 --- a/setuptools/tests/test_integration.py +++ b/setuptools/tests/test_integration.py @@ -28,7 +28,7 @@ def setup_module(module): try: urlopen('https://pypi.python.org/pypi') except Exception as exc: - pytest.skip(reason=str(exc)) + pytest.skip(str(exc)) @pytest.fixture -- cgit v1.2.1