summaryrefslogtreecommitdiffhomepage
path: root/tasks.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-10-25 11:42:19 -0700
committerJeff Forcier <jeff@bitprophet.org>2018-09-17 14:50:02 -0700
commit1fa48b482c2db097da2b69dcaa79b3f7db98f1f0 (patch)
treeb0fa3635fbf146013f293ba95fa86597b89de4d4 /tasks.py
parent6b377c0e33c5d3443883de770a03cdb53140d07c (diff)
Mark known slow tests as 'slow' pytest marker, and skip them by default
Diffstat (limited to 'tasks.py')
-rw-r--r--tasks.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/tasks.py b/tasks.py
index 97dca66b..6053ce1b 100644
--- a/tasks.py
+++ b/tasks.py
@@ -8,9 +8,19 @@ from invocations.packaging.release import ns as release_coll, publish
@task
-def test(ctx, verbose=True, coverage=False, opts=""):
+def test(ctx, verbose=True, coverage=False, include_slow=False, opts=""):
+ """
+ Run unit tests via pytest.
+
+ By default, known-slow parts of the suite are SKIPPED unless
+ ``--include-slow`` is given. (Note that ``--include-slow`` does not mesh
+ well with explicit ``--opts="-m=xxx"`` - if ``-m`` is found in ``--opts``,
+ ``--include-slow`` will be ignored!)
+ """
if verbose and '--verbose' not in opts and '-v' not in opts:
opts += " --verbose"
+ if '-m' not in opts and not include_slow:
+ opts += " -m 'not slow'"
runner = "pytest"
if coverage:
# Leverage how pytest can be run as 'python -m pytest', and then how
@@ -33,7 +43,10 @@ def test(ctx, verbose=True, coverage=False, opts=""):
@task
def coverage(ctx, opts=""):
- return test(ctx, coverage=True, opts=opts)
+ """
+ Execute all tests (normal and slow) with coverage enabled.
+ """
+ return test(ctx, coverage=True, include_slow=True, opts=opts)
# Until we stop bundling docs w/ releases. Need to discover use cases first.