diff options
author | Waylan Limberg <waylan@gmail.com> | 2008-10-14 23:05:59 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2008-10-14 23:05:59 -0400 |
commit | fed09c7435e7b19c59aad9b88ddb0c76912c53e9 (patch) | |
tree | e6358eb49bf2c07fdb867fba282abb13dbe351b4 | |
parent | 4a2e9020d786e72c0be0e9ea42e7dc2f855bb856 (diff) | |
download | markdown-fed09c7435e7b19c59aad9b88ddb0c76912c53e9.tar.gz markdown-fed09c7435e7b19c59aad9b88ddb0c76912c53e9.tar.bz2 markdown-fed09c7435e7b19c59aad9b88ddb0c76912c53e9.zip |
Cleaned up regression test suite code.
-rwxr-xr-x | regression-tests.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/regression-tests.py b/regression-tests.py index 41aa34c..c8f784c 100755 --- a/regression-tests.py +++ b/regression-tests.py @@ -137,19 +137,21 @@ class TestTreap(unittest.TestCase): [('first', 'This'), ('second', 'is'), ('third', 'a'), ('fourth', 'self'), ('seventh','.'), ('fifth', 'test')]) -suite = unittest.TestSuite() -suite.addTest(unittest.makeSuite(TestMarkdownParser)) -suite.addTest(unittest.makeSuite(TestHtmlStash)) -suite.addTest(unittest.makeSuite(TestTreap)) - -for filename in os.listdir('markdown_extensions'): - if filename.endswith('.py'): - module = 'markdown_extensions.%s' % filename[:-3] - try: - suite.addTest(DocTestSuite(module)) - except: ValueError - # No tests +def suite(): + """ Build a test suite of the above tests and extension doctests. """ + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(TestMarkdownParser)) + suite.addTest(unittest.makeSuite(TestHtmlStash)) + suite.addTest(unittest.makeSuite(TestTreap)) + + for filename in os.listdir('markdown_extensions'): + if filename.endswith('.py'): + module = 'markdown_extensions.%s' % filename[:-3] + try: + suite.addTest(DocTestSuite(module)) + except: ValueError + # No tests + return suite if __name__ == '__main__': - #unittest.main() - unittest.TextTestRunner(verbosity=2).run(suite) + unittest.TextTestRunner(verbosity=2).run(suite()) |