diff options
author | Barry Warsaw <barry@python.org> | 2015-01-26 20:02:31 -0500 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2015-01-26 20:02:31 -0500 |
commit | 5e2b8ef0703eb4582a5a8ba50ae7c83a8294d65a (patch) | |
tree | 9f3c2d6d7cdd3e63e52d54152d3dbb15e916d9f3 /tests/unittests/test_cs_util.py | |
parent | fe99f7d6d87e88320933957b2933288c6eb2986d (diff) | |
download | vyos-cloud-init-5e2b8ef0703eb4582a5a8ba50ae7c83a8294d65a.tar.gz vyos-cloud-init-5e2b8ef0703eb4582a5a8ba50ae7c83a8294d65a.zip |
Repair the Python 2.6 tests.
Diffstat (limited to 'tests/unittests/test_cs_util.py')
-rw-r--r-- | tests/unittests/test_cs_util.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/unittests/test_cs_util.py b/tests/unittests/test_cs_util.py index 99fac84d..337ac9a0 100644 --- a/tests/unittests/test_cs_util.py +++ b/tests/unittests/test_cs_util.py @@ -1,7 +1,21 @@ +from __future__ import print_function + +import sys import unittest from cloudinit.cs_utils import Cepko +try: + skip = unittest.skip +except AttributeError: + # Python 2.6. Doesn't have to be high fidelity. + def skip(reason): + def decorator(func): + def wrapper(*args, **kws): + print(reason, file=sys.stderr) + return wrapper + return decorator + SERVER_CONTEXT = { "cpu": 1000, @@ -29,7 +43,7 @@ class CepkoMock(Cepko): # 2015-01-22 BAW: This test is completely useless because it only ever tests # the CepkoMock object. Even in its original form, I don't think it ever # touched the underlying Cepko class methods. -@unittest.skip('This test is completely useless') +@skip('This test is completely useless') class CepkoResultTests(unittest.TestCase): def setUp(self): pass |