Commits

Waylan Limberg committed 7d98828

Last few changes to get other test frameworks to work. Added config options to set file extensions and a few other tweeks.

Comments (0)

Files changed (1)

markdown/tests/__init__.py

                                     join_styles=0,
                                     lower_literals=0,
                                     merge_divs=0,
-                                    #merge_spans=0,
                                     output_xhtml=1,
-                                    #preserve_entities=1,
                                     quote_ampersand=0,
                                     show_body_only=1,
                                     char_encoding='utf8',
         cfg_section = get_section(file, config)
         if config.getboolean(cfg_section, 'skip'):
             raise nose.plugins.skip.SkipTest, 'Test skipped per config.'
-        input_file = file + ".txt"
+        input_file = file + config.get(cfg_section, 'input_ext')
         input = codecs.open(input_file, encoding="utf-8").read()
-        output_file = file + ".html"
+        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'):
                                           'safe_mode': False,
                                           'output_format': 'xhtml1',
                                           'normalize': '0',
-                                          'skip': '0'})
+                                          'skip': '0',
+                                          'input_ext': '.txt',
+                                          'output_ext': '.html'})
         config.read(os.path.join(dir_name, 'test.cfg'))
         # Loop through files and generate tests.
         for file in files:
             root, ext = os.path.splitext(file)
-            if ext == '.txt':
+            if ext == config.get(get_section(file, config), 'input_ext'):
                 path = os.path.join(dir_name, root)
                 check_syntax = CheckSyntax(description=relpath(path, test_dir))
                 yield check_syntax, path, config