test(realestate): truncate tables for isolation instead of file delete

Replace os.remove() in conftest autouse fixture with per-table DELETE
to avoid Windows SQLite file-lock PermissionError being swallowed
silently and leaking state across tests. Remove the inline DELETE
workaround from test_profile_api.py that was coupling the test to
internal DB knowledge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-28 08:45:03 +09:00
parent 20b51f706c
commit d46d2cb30b
2 changed files with 18 additions and 18 deletions

View File

@@ -26,11 +26,7 @@ def test_profile_update_accepts_new_fields():
def test_profile_get_returns_defaults_for_new_fields():
from app.main import app
from app.db import upsert_profile, _conn
# 이전 테스트 데이터 제거 후 새 프로필 삽입
with _conn() as conn:
conn.execute("DELETE FROM user_profile")
from app.db import upsert_profile
upsert_profile({"name": "기본"})
with TestClient(app) as client: