From b7d8833c209583cf1e259decf862eb1b963abcbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=98ehounek?= Date: Mon, 19 Aug 2024 11:15:25 +0200 Subject: [PATCH] fix: Tests not cleaning up properly --- tests/test_upload.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/test_upload.py b/tests/test_upload.py index 778548f..abf6cea 100644 --- a/tests/test_upload.py +++ b/tests/test_upload.py @@ -1,4 +1,3 @@ -import asyncio import dataclasses import os import subprocess @@ -172,14 +171,13 @@ async def source_and_target_schema(client: ElisAPIClient, tmp_path): # In case our test failed to delete the schema(s) try: - await asyncio.gather( - *[ - client.delete_schema(source_schema.id), - client.delete_schema(target_schema.id), - ] - ) + await client.delete_schema(source_schema.id) + except Exception: + print("source_schema already deleted.") + try: + await client.delete_schema(target_schema.id) except Exception: - print("Schema already deleted.") + print("target_schema already deleted.") @pytest.mark.asyncio