fix: use proper test fixtures instead of local_session
Some checks failed
Deploy on push / deploy (push) Failing after 2m17s
Some checks failed
Deploy on push / deploy (push) Failing after 2m17s
- Replace local_session() calls with db_session fixture in tests - Add @pytest.mark.asyncio decorators to async test functions - Fix test_unpublish_shout.py to use proper test database setup - Tests now use in-memory SQLite database with proper schema - All test tables are created automatically via conftest.py fixtures
This commit is contained in:
@@ -247,14 +247,9 @@ with (
|
||||
from orm.community import Community, CommunityAuthor
|
||||
|
||||
@pytest.fixture
|
||||
def oauth_db_session():
|
||||
def oauth_db_session(db_session):
|
||||
"""Фикстура для сессии базы данных в OAuth тестах"""
|
||||
from services.db import local_session
|
||||
session = local_session()
|
||||
try:
|
||||
yield session
|
||||
finally:
|
||||
session.close()
|
||||
return db_session
|
||||
|
||||
@pytest.fixture
|
||||
def simple_user(oauth_db_session):
|
||||
|
||||
Reference in New Issue
Block a user