Skip to content

Commit

Permalink
accept reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SerRichard committed May 29, 2024
1 parent 666ab20 commit df48d33
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ def my_new_cool_auth():
assert response.json()["user_id"] == str(specific_uuid)


@pytest.mark.skip(
reason="Can only be run independently, as it revisions the database and will break the tests which run after."
)
def test_extending_the_usermodel(
mocked_oidc_config, mocked_oidc_userinfo, core_api, app_settings
):
Expand All @@ -345,8 +348,10 @@ class ExtendedUserORM(UserORM):
os.chdir(Path(ALEMBIC_DIR))
alembic_cfg = Config("alembic.ini")

command.revision(alembic_cfg, f"openeo-fastapi-extended", autogenerate=True)
command.upgrade(alembic_cfg, "head")
command.revision(
alembic_cfg, f"openeo-fastapi-extended", rev_id="downgrademe", autogenerate=True
)
command.upgrade(alembic_cfg, revision="downgrademe")

test_app = TestClient(core_api.app)

Expand All @@ -366,4 +371,8 @@ def my_new_cool_auth():
headers={"Authorization": "Bearer /oidc/egi/not-real"},
)

# Downgrade to remove the use of the ExtendedUserORM
# Doesnt seem to work
command.downgrade(alembic_cfg, revision="downgrademe")

assert response.status_code == 200
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def app_settings():
return settings.AppSettings(**SETTINGS_DICT)


@pytest.fixture()
@pytest.fixture(scope="function")
def core_api():
formats = [
FileFormat(
Expand Down Expand Up @@ -189,7 +189,7 @@ def mocked_issuer():
)


@pytest.fixture(autouse=True)
@pytest.fixture(scope="function", autouse=True)
def mock_engine(postgresql):
"""Postgresql engine for SQLAlchemy."""
import os
Expand Down

0 comments on commit df48d33

Please sign in to comment.