diff --git a/tests/back/api/test_experiments_api.py b/tests/back/api/test_experiments_api.py index 466db0a7..8ee032c8 100644 --- a/tests/back/api/test_experiments_api.py +++ b/tests/back/api/test_experiments_api.py @@ -49,7 +49,13 @@ def create_dataset(client): }, files={"file": ("filename", csv, "text/csv")}, ) - return response.json()["id"] + + dataset_id = response.json()["id"] + + yield dataset_id + + response = client.delete(f"/api/v1/dataset/{dataset_id}") + assert response.status_code == 204, response.text @pytest.fixture(scope="module", name="response_1") diff --git a/tests/back/api/test_explainer_jobs.py b/tests/back/api/test_explainer_jobs.py index ae49b9c1..b14b8f0d 100644 --- a/tests/back/api/test_explainer_jobs.py +++ b/tests/back/api/test_explainer_jobs.py @@ -62,7 +62,12 @@ def create_dataset(client): }, files={"file": ("filename", csv, "text/csv")}, ) - return response.json()["id"] + dataset_id = response.json()["id"] + + yield dataset_id + + response = client.delete(f"/api/v1/dataset/{dataset_id}") + assert response.status_code == 204, response.text class DummyTask(BaseTask): diff --git a/tests/back/api/test_runs_api.py b/tests/back/api/test_runs_api.py index 92692270..fcc5daa2 100644 --- a/tests/back/api/test_runs_api.py +++ b/tests/back/api/test_runs_api.py @@ -33,7 +33,12 @@ def create_dataset(client): }, files={"file": ("filename", csv, "text/csv")}, ) - return response.json()["id"] + dataset_id = response.json()["id"] + + yield response.json()["id"] + + response = client.delete(f"/api/v1/dataset/{dataset_id}") + assert response.status_code == 204, response.text @pytest.fixture(scope="module", name="experiment_id") @@ -61,7 +66,10 @@ def create_experiment(client: TestClient, dataset_id): ), }, ) - return response.json()["id"] + + yield response.json()["id"] + response = client.delete(f"/api/v1/experiment/{response.json()['id']}") + assert response.status_code == 204, response.text def test_create_run(client: TestClient, experiment_id: int):