Skip to content

Commit

Permalink
Merge pull request #44 from ubermag/fix-tasks
Browse files Browse the repository at this point in the history
Fix running multiple test commands via invoke
  • Loading branch information
lang-m committed May 21, 2022
2 parents 9bbb8fc + 8e0313d commit d2caf19
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tasks.py
Expand Up @@ -52,9 +52,16 @@ def ipynb(c):
raise Exit(code=result)


@task(unittest, docs, ipynb)
@task
def all(c):
"""Run all tests."""
for cmd in (unittest, docs, ipynb):
try:
cmd(c)
except Exit as e:
if e.code != pytest.ExitCode.OK:
raise e
raise Exit(code=pytest.ExitCode.OK)


test_collection.add_task(unittest)
Expand Down Expand Up @@ -99,7 +106,11 @@ def release(c):
raise Exit("Working tree is not clean. Aborting.")

# run all tests
all(c)
try:
all(c)
except Exit as e:
if e.code != pytest.ExitCode.OK:
raise e

version = iniconfig.IniConfig("setup.cfg").get("metadata", "version")
# sanity checks while we have two places containing the version.
Expand Down

0 comments on commit d2caf19

Please sign in to comment.