- Add Celery synchronous execution settings for tests * CELERY_TASK_ALWAYS_EAGER = True (no separate worker needed) * CELERY_TASK_EAGER_PROPAGATES = True * Use memory broker/backend for tests - Add performance marker to pytest.ini * Allows marking tests with @pytest.mark.performance - Setup Redis server via systemd * Enabled redis-server.service for autostart * Redis runs on 127.0.0.1:6379 - Update .gitignore to exclude dump.rdb (Redis dump file) Integration tests status: - 26/47 tests passing (55%) - 21 tests failing due to missing NotificationType fixtures - Tests no longer hang (Celery executes synchronously) Note: Integration tests require NotificationType fixtures to be created before document operations trigger notification signals.
28 lines
886 B
INI
28 lines
886 B
INI
[pytest]
|
||
DJANGO_SETTINGS_MODULE = eusrr_backend.settings_test
|
||
python_files = tests.py test_*.py *_tests.py
|
||
|
||
# Asyncio mode
|
||
asyncio_mode = auto
|
||
asyncio_default_fixture_loop_scope = function
|
||
|
||
# Markers для категоризации тестов
|
||
markers =
|
||
manual: marks tests as manual (not run by default)
|
||
integration: marks tests as integration tests
|
||
slow: marks tests as slow running
|
||
asyncio: marks tests as asynchronous tests
|
||
performance: marks tests as performance tests
|
||
|
||
# Исключить manual tests по умолчанию
|
||
addopts = -m "not manual" --strict-markers
|
||
|
||
# Пути для сбора тестов
|
||
testpaths = tests employees documents
|
||
|
||
# Игнорировать директории
|
||
norecursedirs = .git .venv __pycache__ node_modules staticfiles media scripts tests/manual
|
||
|
||
# Опции для вывода
|
||
console_output_style = progress
|