From fbc96ca158193c3e692fd5876480cf4927da151a Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 28 Jul 2011 10:59:25 -0400 Subject: 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. --- tests/__init__.py | 6 +++--- tests/util.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3