summaryrefslogtreecommitdiff
path: root/test/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.py')
-rw-r--r--test/test.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/test/test.py b/test/test.py
index bd688c1..2072e18 100644
--- a/test/test.py
+++ b/test/test.py
@@ -75,9 +75,24 @@ class MATTest(unittest.TestCase):
75 shutil.rmtree(self.tmpdir) 75 shutil.rmtree(self.tmpdir)
76 76
77 77
78if __name__ == '__main__': 78def run_all_tests():
79 """
80 This method will run all tests, both for cli and lib.
81 The imports of clitest and libtest are done here because
82 of dependencie on the IS_LOCAL variable.
83
84 If set to true, the tests will be done on the _local_ instance
85 of MAT, else, on the _system-wide_ one.
86 """
79 import clitest 87 import clitest
80 import libtest 88 import libtest
89 SUITE = unittest.TestSuite()
90 SUITE.addTests(clitest.get_tests())
91 SUITE.addTests(libtest.get_tests())
92
93 return unittest.TextTestRunner(verbosity=VERBOSITY).run(SUITE).wasSuccessful()
94
95if __name__ == '__main__':
81 import argparse 96 import argparse
82 97
83 parser = argparse.ArgumentParser(description='MAT testsuite') 98 parser = argparse.ArgumentParser(description='MAT testsuite')
@@ -94,10 +109,4 @@ if __name__ == '__main__':
94 print('Please specify either --local or --system') 109 print('Please specify either --local or --system')
95 sys.exit(1) 110 sys.exit(1)
96 111
97 112 sys.exit(run_all_tests() is False)
98 SUITE = unittest.TestSuite()
99 SUITE.addTests(clitest.get_tests())
100 SUITE.addTests(libtest.get_tests())
101
102 ret = unittest.TextTestRunner(verbosity=VERBOSITY).run(SUITE).wasSuccessful()
103 sys.exit(ret is False)