summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJensDiemer <git@jensdiemer.de>2020-02-07 11:25:55 +0100
committerJensDiemer <git@jensdiemer.de>2020-02-07 11:37:07 +0100
commitd0b7242e8a26bb60a4b550c7df89fd411cd09069 (patch)
treea120145d79b13dbf29bdb3cfbfae841f0285fd0f
parent2cd317caa0b4b32ca2b5547d6469bdf6e8817981 (diff)
downloadcreole-d0b7242e8a26bb60a4b550c7df89fd411cd09069.tar.gz
remove import exceptions in tests: textile and docutils should be installed in tests
-rw-r--r--creole/tests/utils/base_unittest.py34
1 files changed, 2 insertions, 32 deletions
diff --git a/creole/tests/utils/base_unittest.py b/creole/tests/utils/base_unittest.py
index 3d28c94..4541ce1 100644
--- a/creole/tests/utils/base_unittest.py
+++ b/creole/tests/utils/base_unittest.py
@@ -1,4 +1,3 @@
-
"""
unitest base class
~~~~~~~~~~~~~~~~~~
@@ -11,32 +10,12 @@
import re
-import warnings
+import textile
from creole import creole2html, html2creole, html2rest, html2textile
-from creole.exceptions import DocutilsImportError
+from creole.rest_tools.clean_writer import rest2html
from creole.tests.utils.utils import MarkupTest
-try:
- import textile
-except ImportError:
- test_textile = False
- warnings.warn(
- "Markup error: The Python textile library isn't installed."
- " Download: http://pypi.python.org/pypi/textile"
- )
-else:
- test_textile = True
-
-
-try:
- from creole.rest_tools.clean_writer import rest2html
-except DocutilsImportError as err:
- REST_INSTALLED = False
- warnings.warn(f"Can't run all ReSt unittests: {err}")
-else:
- REST_INSTALLED = True
-
tabs2spaces_re = re.compile(r"^(\t*)(.*?)$", re.M)
@@ -252,11 +231,6 @@ class BaseCreoleTest(MarkupTest):
)
# compare textile -> html
- if not test_textile:
- # TODO: Use @unittest.skipIf if python 2.6 will be not support anymore
- warnings.warn("Skip textile test. Please install python textile module.")
- return
-
html = textile.textile(textile_string)
html = html.replace("<br />", "<br />\n")
html = tabs2spaces(html)
@@ -295,10 +269,6 @@ class BaseCreoleTest(MarkupTest):
strip_lines=False, debug=False, prepare_strings=True, **kwargs):
# compare rest -> html
- if not REST_INSTALLED:
- warnings.warn("Skip ReSt test. Please install Docutils.")
- return
-
if prepare_strings:
rest_string = self._prepare_text(rest_string)
html_string = self._prepare_text(html_string)