From 3788c419754cb2daaa7c167f8c7b232dfcbc7af8 Mon Sep 17 00:00:00 2001 From: Martin Lang Date: Sat, 21 May 2022 08:52:09 +0200 Subject: [PATCH] Fix running multiple tests in tasks.py --- tasks.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tasks.py b/tasks.py index 0f2457d..332e650 100644 --- a/tasks.py +++ b/tasks.py @@ -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) @@ -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.