d0e27904b723 — Gerald Klix (speedy) 5 years ago
SUM: Added a test_all script.
1 files changed, 35 insertions(+), 0 deletions(-)

A => tests/test_all.py
A => tests/test_all.py +35 -0
@@ 0,0 1,35 @@ 
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+from unittest import (
+    TestSuite,
+    TextTestRunner,
+    defaultTestLoader as loader,
+)
+
+def test_all():
+    """Run all relevant test cases."""
+    load_class = loader.loadTestsFromTestCase
+    load_module = loader.loadTestsFromModule
+    suite = TestSuite()
+    
+    def load_tests(load, *objects_with_tests):
+        for object_with_tests in objects_with_tests:
+            suite.addTests(load(object_with_tests))
+        
+    from textest import suite as textest_suite
+    suite.addTests((textest_suite,))
+
+    import testgo
+    
+    load_tests(
+        load_module,
+        testgo,
+    )
+
+    runner = TextTestRunner(verbosity=2)
+    runner.run(suite)
+    
+    
+if __name__ == "__main__":
+    test_all()