Skip to content

Commit

Permalink
Merge pull request #32 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 authored May 21, 2022
2 parents f35d614 + 16174ef commit ba7a771
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,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 @@ -93,7 +100,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 ba7a771

Please sign in to comment.