mirror of
https://gitlab.com/tildes/tildes.git
synced 2026-04-17 23:08:32 +02:00
Add --full flag to invoke test
This is simpler than needing to know that --html-validation is the flag to use to make sure that all tests are run, and can stay constant even if we add other types of excluded-by-default tests in the future.
This commit is contained in:
@@ -3,4 +3,4 @@
|
||||
# Pre-push hook script that ensures all tests and code checks pass
|
||||
|
||||
vagrant ssh -c ". activate \
|
||||
&& invoke type-checking test --quiet --html-validation check-code-style --full"
|
||||
&& invoke type-checking test --quiet --full check-code-style --full"
|
||||
|
||||
@@ -39,12 +39,13 @@ def check_code_style(context, full=False):
|
||||
|
||||
@task(
|
||||
help={
|
||||
"full": "Include all tests",
|
||||
"html-validation": "Include HTML validation (very slow, includes webtests)",
|
||||
"quiet": "Reduce verbosity",
|
||||
"webtests": "Include webtests (a little slow)",
|
||||
}
|
||||
)
|
||||
def test(context, quiet=False, webtests=False, html_validation=False):
|
||||
def test(context, full=False, quiet=False, webtests=False, html_validation=False):
|
||||
"""Run the tests.
|
||||
|
||||
By default, webtests (ones that make actual HTTP requests to the app) and HTML
|
||||
@@ -58,10 +59,11 @@ def test(context, quiet=False, webtests=False, html_validation=False):
|
||||
pytest_args = []
|
||||
excluded_markers = []
|
||||
|
||||
if not webtests:
|
||||
excluded_markers.append("webtest")
|
||||
if not html_validation:
|
||||
excluded_markers.append("html_validation")
|
||||
if not full:
|
||||
if not webtests:
|
||||
excluded_markers.append("webtest")
|
||||
if not html_validation:
|
||||
excluded_markers.append("html_validation")
|
||||
|
||||
if excluded_markers:
|
||||
excluded_marker_str = " or ".join(excluded_markers)
|
||||
|
||||
Reference in New Issue
Block a user