diff options
author | JensDiemer <git@jensdiemer.de> | 2014-05-15 13:36:59 +0200 |
---|---|---|
committer | JensDiemer <git@jensdiemer.de> | 2014-05-15 13:36:59 +0200 |
commit | 3c1b88caa526ed59724b3ffbebcd3f98d091461b (patch) | |
tree | fc1031cc5dacc5aa2813581d2ed35f955f5b0c79 | |
parent | 9a7a1e14f3f77086c75b52b30107d0f19eebe906 (diff) | |
download | creole-3c1b88caa526ed59724b3ffbebcd3f98d091461b.tar.gz |
fix unitest for python2.6
-rw-r--r-- | creole/tests/test_creole2html.py | 2 | ||||
-rw-r--r-- | creole/tests/test_setup_utils.py | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/creole/tests/test_creole2html.py b/creole/tests/test_creole2html.py index 804f053..c37684c 100644 --- a/creole/tests/test_creole2html.py +++ b/creole/tests/test_creole2html.py @@ -76,8 +76,8 @@ class TestCreole2html(BaseCreoleTest): tb_lines += [" -"*40] tb = "\n".join([" >>> %s" % l for l in tb_lines]) msg = "%r not found in:\n%s" % (part, tb) + # TODO: use assertIn if python 2.6 will be not support anymore. if part not in error_msg: - # assertIn is new in Python 2.7 ;) raise self.failureException(msg) def test_example_macros1(self): diff --git a/creole/tests/test_setup_utils.py b/creole/tests/test_setup_utils.py index 682200a..6b5735d 100644 --- a/creole/tests/test_setup_utils.py +++ b/creole/tests/test_setup_utils.py @@ -7,7 +7,7 @@ https://code.google.com/p/python-creole/wiki/UseInSetup - :copyleft: 2011-2012 by python-creole team, see AUTHORS for more details. + :copyleft: 2011-2014 by python-creole team, see AUTHORS for more details. :license: GNU GPL v3 or above, see LICENSE for more details. """ @@ -15,6 +15,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera import unittest import os +import warnings try: import docutils @@ -34,8 +35,16 @@ TEST_README_DIR = os.path.abspath(os.path.dirname(__file__)) TEST_README_FILENAME = "test_README.creole" -@unittest.skipIf(DOCUTILS == False, "docutils not installed.") +# TODO: Use @unittest.skipIf if python 2.6 will be not support anymore. +# @unittest.skipIf(DOCUTILS == False, "docutils not installed.") class SetupUtilsTests(BaseCreoleTest): + def run(self, *args, **kwargs): + # TODO: Remove if python 2.6 will be not support anymore. + if DOCUTILS == False: + warnings.warn("Skip SetupUtilsTests, because 'docutils' not installed.") + return + return super(SetupUtilsTests, self).run(*args, **kwargs) + def test_creole_package_path(self): self.assertTrue( os.path.isdir(CREOLE_PACKAGE_ROOT), |