Improve topic sorting: add popular sorting by publications and authors count

This commit is contained in:
2025-06-02 02:56:11 +03:00
parent baca19a4d5
commit 3327976586
113 changed files with 7238 additions and 3739 deletions

View File

@@ -1,31 +1,21 @@
import asyncio
import pytest
from services.redis import redis
from tests.test_config import get_test_client
@pytest.fixture(scope="session")
def event_loop():
"""Create an instance of the default event loop for the test session."""
loop = asyncio.get_event_loop_policy().new_event_loop()
yield loop
loop.close()
@pytest.fixture(scope="session")
def test_app():
"""Create a test client and session factory."""
client, SessionLocal = get_test_client()
return client, SessionLocal
client, session_local = get_test_client()
return client, session_local
@pytest.fixture
def db_session(test_app):
"""Create a new database session for a test."""
_, SessionLocal = test_app
session = SessionLocal()
_, session_local = test_app
session = session_local()
yield session