mirror of
https://github.com/bsedin/matrix-webhook.git
synced 2026-04-09 11:25:40 +00:00
setup coverage
This commit is contained in:
19
tests/start.py
Executable file
19
tests/start.py
Executable 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())
|
||||
Reference in New Issue
Block a user