From 43f7e1e7a18078e70b25810343ae469af938bab0 Mon Sep 17 00:00:00 2001 From: Biryuzovye Kleshni Date: Sat, 23 Jun 2018 13:19:59 +0000 Subject: [PATCH] Improved unit tests loading --- src/workprover/test.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/workprover/test.py b/src/workprover/test.py index 09b27a67..a45d7dd1 100755 --- a/src/workprover/test.py +++ b/src/workprover/test.py @@ -185,21 +185,22 @@ class TestWorkProver(unittest.TestCase): self.thread.commandsQueue.put(("shutdown", )) self.thread.join() -loader = unittest.TestLoader() - -suite = unittest.TestSuite([ - loader.loadTestsFromTestCase(TestUtils), - loader.loadTestsFromTestCase(TestDumbSolver), - loader.loadTestsFromTestCase(TestForkingSolver), - loader.loadTestsFromTestCase(TestFastSolver), - loader.loadTestsFromTestCase(TestGPUSolver), - loader.loadTestsFromTestCase(TestWorkProver) -]) +def load_tests(loader, tests, pattern): + return unittest.TestSuite([ + loader.loadTestsFromTestCase(TestUtils), + loader.loadTestsFromTestCase(TestDumbSolver), + loader.loadTestsFromTestCase(TestForkingSolver), + loader.loadTestsFromTestCase(TestFastSolver), + loader.loadTestsFromTestCase(TestGPUSolver), + loader.loadTestsFromTestCase(TestWorkProver) + ]) if __name__ == "__main__": import multiprocessing multiprocessing.freeze_support() + loader = unittest.TestLoader() runner = unittest.TextTestRunner() - runner.run(suite) + + runner.run(load_tests(loader, [], None))