summaryrefslogtreecommitdiff
path: root/tests/test_syntax.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2012-12-21 16:19:30 -0500
committerWaylan Limberg <waylan@gmail.com>2012-12-21 16:19:30 -0500
commitdc7aedfe825b02bd2cb526c0aba9c421822a37d1 (patch)
tree53b70d78cef1857d86d8d1d2a406e832a2a7ac5f /tests/test_syntax.py
parentd4ce5e1bbc4488747e3387811fa0fd8f5c5ac2e8 (diff)
downloadpython-markdown-tox.tar.gz
tox now installs tests as a module. Still not running sytax tests. Package_data (in setup-tests.py) doesn't recursively search subdirs - need to do so manually.tox
Diffstat (limited to 'tests/test_syntax.py')
-rw-r--r--tests/test_syntax.py30
1 files changed, 26 insertions, 4 deletions
diff --git a/tests/test_syntax.py b/tests/test_syntax.py
index ab7299d..1af9a46 100644
--- a/tests/test_syntax.py
+++ b/tests/test_syntax.py
@@ -4,8 +4,30 @@ import markdown
import codecs
import difflib
import nose
-from . import util
-from .plugins import HtmlOutput, Markdown
+
+import sys
+if sys.version_info[0] == 3:
+ from configparser import SafeConfigParser
+else:
+ from ConfigParser import SafeConfigParser
+
+class MarkdownSyntaxError(Exception):
+ pass
+
+
+class CustomConfigParser(SafeConfigParser):
+ def get(self, section, option):
+ value = SafeConfigParser.get(self, section, option)
+ if option == 'extensions':
+ if len(value.strip()):
+ return value.split(',')
+ else:
+ return []
+ if value.lower() in ['yes', 'true', 'on', '1']:
+ return True
+ if value.lower() in ['no', 'false', 'off', '0']:
+ return False
+ return value
try:
import tidy
except ImportError:
@@ -29,7 +51,7 @@ def relpath(path, start=test_dir):
def get_config(dir_name):
""" Get config for given directory name. """
- config = util.CustomConfigParser({'normalize': '0',
+ config = CustomConfigParser({'normalize': '0',
'skip': '0',
'input_ext': '.txt',
'output_ext': '.html'})
@@ -101,7 +123,7 @@ class CheckSyntax(object):
'actual_output.html',
n=3)]
if diff:
- raise util.MarkdownSyntaxError('Output from "%s" failed to match expected '
+ raise MarkdownSyntaxError('Output from "%s" failed to match expected '
'output.\n\n%s' % (input_file, ''.join(diff)))
def TestSyntax():