Move cli interface code in package

This commit is contained in:
Patrick Jentsch
2023-05-11 16:33:21 +02:00
parent 8c935820e8
commit 336bbc39e4
11 changed files with 121 additions and 83 deletions

5
app/tests/__init__.py Normal file
View File

@ -0,0 +1,5 @@
from flask import Blueprint
bp = Blueprint('tests', __name__)
from . import cli

9
app/tests/cli.py Normal file
View File

@ -0,0 +1,9 @@
from unittest import TestLoader, TextTestRunner
from unittest.suite import TestSuite
from . import bp
@bp.cli.command('run')
def run_test():
''' Run unit tests. '''
tests: TestSuite = TestLoader().discover('tests')
TextTestRunner(verbosity=2).run(tests)