Fix db.py connection handling and test isolation
db.py: - Add conn.isolation_level = None to get_conn() — fixes row_factory + autocommit conflict. row_factory disables implicit transactions, so we need explicit autocommit mode. - Remove all conn.commit() calls (unnecessary with autocommit) pyproject.toml: - Move pytest + pytest-asyncio to main dependencies (uv run pytest uses ephemeral env with main deps only) tests/test_db.py: - Fix test_upsert_user_updates_username to not chain upsert_user() calls in assert expressions (test isolation issue)
This commit is contained in:
@@ -6,10 +6,6 @@ requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
"python-telegram-bot>=21.6",
|
||||
"dateparser>=1.2.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest>=8.3.5",
|
||||
"pytest-asyncio>=0.25.2",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user