Skip to content

Commit

Permalink
Autobuilding example project
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescurtin committed Oct 10, 2024
1 parent 6aaca67 commit ad2fe22
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions my_flask_app/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@
is_flag=True,
help="Show coverage report",
)
def test(coverage):
@click.option(
"-k",
"--filter",
default=None,
help="Filter tests by keyword expressions",
)
def test(coverage, filter):
"""Run the tests."""
import pytest

args = [TEST_PATH, "--verbose"]
if coverage:
args.append("--cov=my_flask_app")
rv = pytest.main(args)
if filter:
args.extend(["-k", filter])
rv = pytest.main(args=args)
exit(rv)


Expand Down

0 comments on commit ad2fe22

Please sign in to comment.