Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 8, 2024
1 parent 3d3b734 commit bc6abc5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/routers/openml/migration/datasets_migration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import httpx
import pytest
from core.conversions import nested_remove_single_element_list
from starlette.testclient import TestClient

from core.conversions import nested_remove_single_element_list
from tests.conftest import ApiKey


Expand Down Expand Up @@ -161,7 +161,10 @@ def test_dataset_tag_response_is_identical(
"/data/tag",
data={"api_key": api_key, "tag": tag, "data_id": dataset_id},
)
already_tagged = original.status_code == HTTPStatus.INTERNAL_SERVER_ERROR and "already tagged" in original.json()["error"]["message"]
already_tagged = (

Check warning on line 164 in tests/routers/openml/migration/datasets_migration_test.py

View check run for this annotation

Codecov / codecov/patch

tests/routers/openml/migration/datasets_migration_test.py#L164

Added line #L164 was not covered by tests
original.status_code == HTTPStatus.INTERNAL_SERVER_ERROR
and "already tagged" in original.json()["error"]["message"]
)
if not already_tagged:
# undo the tag, because we don't want to persist this change to the database
# Sometimes a change is already committed to the database even if an error occurs.
Expand All @@ -170,8 +173,8 @@ def test_dataset_tag_response_is_identical(
data={"api_key": api_key, "tag": tag, "data_id": dataset_id},
)
if (
original.status_code != HTTPStatus.OK
and original.json()["error"]["message"] == "An Elastic Search Exception occured."
original.status_code != HTTPStatus.OK
and original.json()["error"]["message"] == "An Elastic Search Exception occured."
):
pytest.skip("Encountered Elastic Search error.")

Check warning on line 179 in tests/routers/openml/migration/datasets_migration_test.py

View check run for this annotation

Codecov / codecov/patch

tests/routers/openml/migration/datasets_migration_test.py#L179

Added line #L179 was not covered by tests
new = py_api.post(
Expand Down

0 comments on commit bc6abc5

Please sign in to comment.