summaryrefslogtreecommitdiff
path: root/tasks.py
diff options
context:
space:
mode:
authorEric Lin <anselor@gmail.com>2020-07-07 15:57:02 -0400
committeranselor <anselor@gmail.com>2020-07-11 17:30:40 -0400
commit601a8e271020ca1b0918deabf70ad0778ded7d4a (patch)
tree48f2134a71a2478c00eb9df33e69b30c0ae39002 /tasks.py
parent28e43bf24f8a5bc0b2e896938e76e17524d12ed3 (diff)
downloadcmd2-git-601a8e271020ca1b0918deabf70ad0778ded7d4a.tar.gz
external test plugin tests and coverage should now run
Diffstat (limited to 'tasks.py')
-rw-r--r--tasks.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tasks.py b/tasks.py
index ca380a91..5f6a2609 100644
--- a/tasks.py
+++ b/tasks.py
@@ -51,13 +51,13 @@ namespace.add_collection(namespace_clean, 'clean')
#####
-@invoke.task(post=[plugin_tasks.pytest])
+@invoke.task()
def pytest(context, junit=False, pty=True):
"""Run tests and code coverage using pytest"""
with context.cd(TASK_ROOT_STR):
- command_str = 'pytest --cov=cmd2 --cov-report=term --cov-report=html'
+ command_str = 'pytest --cov=cmd2 --cov-report=term --cov-report=html '
if junit:
- command_str += ' --junitxml=junit/test-results.xml'
+ command_str += ' --junitxml=junit/test-results.xml '
command_str += ' tests'
context.run(command_str, pty=pty)
@@ -228,7 +228,7 @@ def dist_clean(context):
namespace_clean.add_task(dist_clean, 'dist')
-@invoke.task(post=[plugin_tasks.eggs_clean])
+@invoke.task()
def eggs_clean(context):
"""Remove egg directories"""
# pylint: disable=unused-argument
@@ -246,7 +246,7 @@ def eggs_clean(context):
namespace_clean.add_task(eggs_clean, 'eggs')
-@invoke.task(post=[plugin_tasks.pycache_clean])
+@invoke.task()
def pycache_clean(context):
"""Remove __pycache__ directories"""
# pylint: disable=unused-argument
@@ -266,6 +266,7 @@ namespace_clean.add_task(pycache_clean, 'pycache')
clean_tasks = list(namespace_clean.tasks.values())
clean_tasks.append(plugin_tasks.clean_all)
+
@invoke.task(pre=clean_tasks, default=True)
def clean_all(_):
"""Run all clean tasks"""