Skip to content

Commit 4e74d54

Browse files
committed
fix: remove transaction commit from duplicate guild ID test
Database integrity constraints are enforced during flush(), not just on commit(). Remove unnecessary commit() and rollback() calls - the fixture handles transaction cleanup. Fixes test: TestDatabaseIntegrity::test_duplicate_guild_id_rejected
1 parent c1fe78a commit 4e74d54

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

tests/integration/test_api_endpoints.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ async def test_duplicate_guild_id_rejected(
526526
guild1 = Guild(guild_id=5555, guild_name="First Guild")
527527
db_session.add(guild1)
528528
await db_session.flush()
529-
await db_session.commit()
530529

531530
# Try to create duplicate - should raise integrity error
532531
from sqlalchemy.exc import IntegrityError
@@ -537,8 +536,6 @@ async def test_duplicate_guild_id_rejected(
537536
with pytest.raises(IntegrityError):
538537
await db_session.flush()
539538

540-
await db_session.rollback()
541-
542539
async def test_foreign_key_constraint_enforced(
543540
self,
544541
db_session: AsyncSession,

0 commit comments

Comments
 (0)