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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user