From efa244322af59350056ffe3b93f7d4728d5ce61e Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Fri, 29 Apr 2011 00:59:06 -0400 Subject: The Testing Framework will now pass any non-reserved args set in test.cfg files as keyword arguments to Markdown for a given syntax test. As Markdown ignores unknown args, this should be safe and will allow testing of any newly added keywords without additional modification of the testing framework. --- tests/__init__.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/__init__.py') diff --git a/tests/__init__.py b/tests/__init__.py index bad2a37..8fbc5d9 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -43,8 +43,10 @@ def get_args(file, config): """ Get args to pass to markdown from config for a given file. """ args = {} section = get_section(file, config) - for key in ['extensions', 'safe_mode', 'output_format']: - args[key] = config.get(section, key) + for key, v in config.items(section): + # Filter out args unique to testing framework + if key not in ['normalize', 'skip', 'input_ext', 'output_ext']: + args[key] = config.get(section, key) return args def normalize(text): @@ -97,10 +99,7 @@ class CheckSyntax(object): def TestSyntax(): for dir_name, sub_dirs, files in os.walk(test_dir): # Get dir specific config settings. - config = util.CustomConfigParser({'extensions': '', - 'safe_mode': False, - 'output_format': 'xhtml1', - 'normalize': '0', + config = util.CustomConfigParser({'normalize': '0', 'skip': '0', 'input_ext': '.txt', 'output_ext': '.html'}) -- cgit v1.2.3