libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 85c067cb59043ced9c09b1d241df023b3f81b62d
parent ed681b728dcb2850047a42f757a21dffb7abb4f8
Author: MS <ms@taler.net>
Date:   Thu, 21 Jan 2021 14:38:22 +0100

Integration tests harness.

Make sure teardown function gets run
even when the setup function fails and
the test itself gets skipped.

Diffstat:
Mintegration-tests/tests.py | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/integration-tests/tests.py b/integration-tests/tests.py @@ -67,7 +67,7 @@ def prepareNexus(): assertResponse( post( f"{PERSONA.nexus.base_url}/users", - auth=auth.HTTPBasicAuth("admin", "x"), + auth=auth.HTTPBasicAuth("adminx", "x"), json=dict(username=PERSONA.nexus.username, password=PERSONA.nexus.password), ) ) @@ -118,8 +118,12 @@ dropNexusTables(DB) startNexus(DB) def setup_function(): - prepareSandbox() - prepareNexus() + try: + prepareSandbox() + prepareNexus() + except Exception: + teardown_function() + pytest.xfail("Failed to setup this test") def teardown_function(): dropSandboxTables(DB)