From a4a6702758cf60ecb8742d78e576733dbbdbb9a0 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 10 Feb 2015 20:32:32 +0000 Subject: make bddeb work with python3 or python2 painful, and not perfect, but at this point the output builds on a vivid system python2 (bddeb --python2) or python3. * remove use of cheetah by bddeb in favor of builtin renderer * add '--python2' flag to bddeb and knowledge of python 2 and python3 package names. * read-dependencies can now read test-requirements also. * differenciate from build-requirements and runtime requirements. --- tests/unittests/test_templating.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'tests/unittests/test_templating.py') diff --git a/tests/unittests/test_templating.py b/tests/unittests/test_templating.py index fbad405f..2b821150 100644 --- a/tests/unittests/test_templating.py +++ b/tests/unittests/test_templating.py @@ -27,20 +27,6 @@ import textwrap from cloudinit import templater -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 - class TestTemplates(test_helpers.TestCase): def test_render_basic(self): @@ -58,7 +44,7 @@ class TestTemplates(test_helpers.TestCase): out_data = templater.basic_render(in_data, {'b': 2}) self.assertEqual(expected_data.strip(), out_data) - @skipIf(six.PY3, 'Cheetah is not compatible with Python 3') + @test_helpers.skipIf(six.PY3, 'Cheetah is not compatible with Python 3') def test_detection(self): blob = "## template:cheetah" -- cgit v1.2.3