From 2d0ca72cde42f72babbce5823ea3bbf30a61021c Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 31 Aug 2018 22:13:09 +0000 Subject: Fix the built-in cloudinit/tests/helpers:skipIf this version uses unittest2 skipIf which is present in our python 2.6 environment. --- cloudinit/tests/helpers.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'cloudinit') diff --git a/cloudinit/tests/helpers.py b/cloudinit/tests/helpers.py index 5bfe7fa4..a022a7a0 100644 --- a/cloudinit/tests/helpers.py +++ b/cloudinit/tests/helpers.py @@ -10,7 +10,6 @@ import shutil import sys import tempfile import time -import unittest import mock import six @@ -33,6 +32,7 @@ from cloudinit import util # Used for skipping tests SkipTest = unittest2.SkipTest +skipIf = unittest2.skipIf # Used for detecting different python versions PY2 = False @@ -425,21 +425,6 @@ def readResource(name, mode='r'): return fh.read() -try: - skipIf = unittest.skipIf -except AttributeError: - # Python 2.6. Doesn't have to be high fidelity. - def skipIf(condition, reason): - def decorator(func): - def wrapper(*args, **kws): - if condition: - return func(*args, **kws) - else: - print(reason, file=sys.stderr) - return wrapper - return decorator - - try: import jsonschema assert jsonschema # avoid pyflakes error F401: import unused -- cgit v1.2.3