Skip to content

Commit b0a0a28

Browse files
Improvement
1 parent 7705e5d commit b0a0a28

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ upgrade:
2727
uv sync --upgrade
2828

2929
ruff:
30-
uv run ruff check
30+
uv run ruff check --fix
3131
uv run ruff format
3232

3333
flake8:

tests_integration/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from testcontainers.core.container import DockerContainer
1212

1313
import app.config as config
14+
import app.dao.customer_dao as customer_dao
15+
import app.routers.customer as customer
1416
import app.db.database_config as database_config
1517
import app.db_schema_migrations.yoyo_migration as yoyo_migration
1618
import app.main as main
@@ -61,11 +63,15 @@ def change_postgres_db_host(
6163
new_settings = patch_env_var(monkeypatch, name, new_value)
6264
reload(yoyo_migration)
6365
reload(database_config)
66+
reload(customer)
67+
reload(customer_dao)
6468
yield new_settings
6569
# reset to original value and reload module
6670
patch_env_var(monkeypatch, name, original_value)
6771
reload(yoyo_migration)
6872
reload(database_config)
73+
reload(customer)
74+
reload(customer_dao)
6975

7076

7177
@pytest.fixture
@@ -79,11 +85,15 @@ def change_postgres_db_port(
7985
new_settings = patch_env_var(monkeypatch, name, new_value)
8086
reload(yoyo_migration)
8187
reload(database_config)
88+
reload(customer)
89+
reload(customer_dao)
8290
yield new_settings
8391
# reset to original value and reload module
8492
patch_env_var(monkeypatch, name, original_value)
8593
reload(yoyo_migration)
8694
reload(database_config)
95+
reload(customer)
96+
reload(customer_dao)
8797

8898

8999
@pytest.fixture

tests_integration/routers/test_customer.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
11
from typing import Any
22

3-
import pytest
43
from assertpy import assert_that
54
from fastapi.encoders import jsonable_encoder
65
from fastapi.testclient import TestClient
7-
from importlib import reload
86

97
from httpx import Response
108

11-
import app.routers.customer as customer
129
from app.model.customer import Customer
1310

1411
CUSTOMERS_ENDPOINT = "/context/customers"
1512

1613

17-
@pytest.fixture
18-
def reload_customer_router() -> None:
19-
reload(customer)
20-
return None
21-
22-
2314
def test_customers_insert_read_delete(
2415
test_client: TestClient,
25-
reload_customer_router: None,
2616
):
2717
initial_delete_response: Response = test_client.delete(CUSTOMERS_ENDPOINT)
2818
assert_that(initial_delete_response.status_code).is_equal_to(204)

0 commit comments

Comments
 (0)