From 30973455d4ca79d0d08a0ccce42c4a22722688ed Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Sun, 9 Aug 2009 13:07:50 +0100 Subject: [PATCH] Add a basic test runner. --- tests/test_all.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 tests/test_all.py diff --git a/tests/test_all.py b/tests/test_all.py new file mode 100755 index 00000000..32e58aba --- /dev/null +++ b/tests/test_all.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import unittest + +def suite(): + suite = unittest.TestSuite() + for _, _, files in os.walk('.'): + for name in filter(is_test, files): + tests = unittest.defaultTestLoader.loadTestsFromName(name[:-3]) + suite.addTests(tests) + return suite + +def is_test(filename): + return filename.startswith('test_') and filename.endswith('.py') + +if __name__ == "__main__": + unittest.main(defaultTest="suite") -- 2.39.5