Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
runner_tests.py 575 B
# -*- coding: utf-8 -*-
"""
Runner for all tests regarding the plotid project.
Includes starting all tests and measuring the code coverage.
"""
import sys
import unittest
import coverage
cov = coverage.Coverage()
cov.start()
loader = unittest.TestLoader()
tests = loader.discover('tests')
testRunner = unittest.runner.TextTestRunner(verbosity=2)
result = testRunner.run(tests)
cov.stop()
cov.save()
cov.report(show_missing=True)
if result.wasSuccessful():
covered = cov.report()
assert covered > 90, "Not enough coverage."
sys.exit(0)
else:
sys.exit(1)