setup coverage

This commit is contained in:
Guilhem Saurel
2021-07-11 16:17:09 +02:00
parent abe6497421
commit 999b824874
8 changed files with 46 additions and 23 deletions

19
tests/start.py Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python
"""Entry point to start an instrumentalized bot for coverage and run tests."""
from subprocess import Popen, run
from unittest import main
def run_and_test():
"""Launch the bot and its tests."""
bot = Popen(['coverage', 'run', 'matrix_webhook.py'])
ret = main(module=None, exit=False).result.wasSuccessful()
bot.terminate()
for cmd in ['report', 'html', 'xml']:
run(['coverage', cmd])
return ret
if __name__ == '__main__':
exit(not run_and_test())