Skip to content

Commit

Permalink
Fix running multiple tests in tasks.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lang-m committed May 21, 2022
1 parent 8ac248b commit 3788c41
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tasks.py
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 3788c41

Please sign in to comment.