File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed
Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ upgrade:
2727 uv sync --upgrade
2828
2929ruff :
30- uv run ruff check
30+ uv run ruff check --fix
3131 uv run ruff format
3232
3333flake8 :
Original file line number Diff line number Diff line change 1111from testcontainers .core .container import DockerContainer
1212
1313import app .config as config
14+ import app .dao .customer_dao as customer_dao
15+ import app .routers .customer as customer
1416import app .db .database_config as database_config
1517import app .db_schema_migrations .yoyo_migration as yoyo_migration
1618import 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
Original file line number Diff line number Diff line change 11from typing import Any
22
3- import pytest
43from assertpy import assert_that
54from fastapi .encoders import jsonable_encoder
65from fastapi .testclient import TestClient
7- from importlib import reload
86
97from httpx import Response
108
11- import app .routers .customer as customer
129from app .model .customer import Customer
1310
1411CUSTOMERS_ENDPOINT = "/context/customers"
1512
1613
17- @pytest .fixture
18- def reload_customer_router () -> None :
19- reload (customer )
20- return None
21-
22-
2314def 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 )
You can’t perform that action at this time.
0 commit comments