diff options
author | Waylan Limberg <waylan@gmail.com> | 2011-07-28 10:59:25 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2011-07-28 10:59:25 -0400 |
commit | fbc96ca158193c3e692fd5876480cf4927da151a (patch) | |
tree | 0f2577fff65b0d10b72118f4980aa1be7d768384 | |
parent | af74ff4dd4ca93f63cdf0a9d7dc8b1258f13fe1a (diff) | |
download | markdown-fbc96ca158193c3e692fd5876480cf4927da151a.tar.gz markdown-fbc96ca158193c3e692fd5876480cf4927da151a.tar.bz2 markdown-fbc96ca158193c3e692fd5876480cf4927da151a.zip |
Python 3.2 made some changes to the configparser which broke the testing framework. With a simple addition to our subclass (which we then make use of), this is an easy fix.
-rw-r--r-- | tests/__init__.py | 6 | ||||
-rw-r--r-- | tests/util.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/__init__.py b/tests/__init__.py index 3cc90b7..99eae44 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -73,18 +73,18 @@ class CheckSyntax(object): def __call__(self, file, config): """ Compare expected output to actual output and report result. """ cfg_section = get_section(file, config) - if config.getboolean(cfg_section, 'skip'): + if config.get(cfg_section, 'skip'): raise nose.plugins.skip.SkipTest, 'Test skipped per config.' input_file = file + config.get(cfg_section, 'input_ext') input = codecs.open(input_file, encoding="utf-8").read() output_file = file + config.get(cfg_section, 'output_ext') expected_output = codecs.open(output_file, encoding="utf-8").read() output = markdown.markdown(input, **get_args(file, config)) - if tidy and config.getboolean(cfg_section, 'normalize'): + if tidy and config.get(cfg_section, 'normalize'): # Normalize whitespace before comparing. expected_output = normalize(expected_output) output = normalize(output) - elif config.getboolean(cfg_section, 'normalize'): + elif config.get(cfg_section, 'normalize'): # Tidy is not available. Skip this test. raise nose.plugins.skip.SkipTest, 'Test skipped. Tidy not available in system.' diff = [l for l in difflib.unified_diff(expected_output.splitlines(True), diff --git a/tests/util.py b/tests/util.py index a960104..6690eed 100644 --- a/tests/util.py +++ b/tests/util.py @@ -12,8 +12,8 @@ class CustomConfigParser(SafeConfigParser): return value.split(',') else: return [] - if value.lower() in ['yes', 'true', 'on']: + if value.lower() in ['yes', 'true', 'on', '1']: return True - if value.lower() in ['no', 'false', 'off']: + if value.lower() in ['no', 'false', 'off', '0']: return False return value |