From d47b37d07dbda0e4849e93a7213a6963622d0fc4 Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Wed, 8 Jul 2015 13:08:40 +0100 Subject: [PATCH] Fix tests on python 2.6 and mark as deprecated Pin mock to < 1.1 as newer versions no longer work on python 2.6. Remove duplicate unittest2 for python 2.6 test env. Adding warning to mark python 2.6 support as deprecated and intended to be removed. Testtools re-added the requirement for unittest2 so the separate dependency for python 2.6 created a duplicate error that causes tox to fail. Change-Id: Ia79eeeb5d2432cf1025631a1722de5fb1babe2c9 --- jenkins/__init__.py | 6 ++++++ test-requirements.txt | 2 +- tox.ini | 5 ----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/jenkins/__init__.py b/jenkins/__init__.py index aa5ffce..58afac3 100644 --- a/jenkins/__init__.py +++ b/jenkins/__init__.py @@ -49,6 +49,8 @@ import base64 import json import re import socket +import sys +import warnings import six from six.moves.http_client import BadStatusLine @@ -57,6 +59,10 @@ from six.moves.urllib.error import URLError from six.moves.urllib.parse import quote, urlencode from six.moves.urllib.request import Request, urlopen +if sys.version_info < (2, 7, 0): + warnings.warn("Support for python 2.6 is deprecated and will be removed.") + + LAUNCHER_SSH = 'hudson.plugins.sshslaves.SSHLauncher' LAUNCHER_COMMAND = 'hudson.slaves.CommandLauncher' LAUNCHER_JNLP = 'hudson.slaves.JNLPLauncher' diff --git a/test-requirements.txt b/test-requirements.txt index c4df181..a4e1693 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ coverage>=3.6 discover hacking>=0.5.6,<0.11 -mock +mock<1.1 unittest2 python-subunit sphinx>=1.1.2,<1.2 diff --git a/tox.ini b/tox.ini index 0f23aa3..9e6eb3c 100644 --- a/tox.ini +++ b/tox.ini @@ -17,11 +17,6 @@ commands = coverage report --omit="tests/*" --show-missing coverage html --omit="tests/*" -d cover -[testenv:py26] -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - unittest2 - [tox:jenkins] downloadcache = ~/cache/pip