forked from crops/crops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
32 lines (26 loc) · 844 Bytes
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
''' CROPS test runner '''
import unittest
import sys
def run_unittests():
''' Execute Unit Tests '''
tests = unittest.TestLoader().discover('tests/unit')
result = unittest.TextTestRunner(verbosity=2).run(tests)
return result.wasSuccessful()
def run_functional_tests():
''' Execute Functional Tests '''
tests = unittest.TestLoader().discover('tests/functional')
result = unittest.TextTestRunner(verbosity=2).run(tests)
return result.wasSuccessful()
if __name__ == '__main__':
print "#" * 70
print "Test Runner: Unit tests"
print "#" * 70
unit_results = run_unittests()
print "#" * 70
print "Test Runner: Functional tests"
print "#" * 70
functional_results = run_functional_tests()
if unit_results and functional_results:
sys.exit(0)
else:
sys.exit(1)