mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-23 22:22:11 -03:00
test(backend): Phase 1 - Improve testing infrastructure and add error path tests
## Changes ### pytest-asyncio Integration - Add pytest-asyncio>=0.21.0 to requirements-dev.txt - Update pytest.ini with asyncio_mode=auto and fixture loop scope - Remove custom pytest_pyfunc_call handler from conftest.py - Add @pytest.mark.asyncio to 21 async test functions ### Error Path Tests - Create test_downloader_error_paths.py with 19 new tests covering: - DownloadStreamControl state management (6 tests) - Downloader configuration and initialization (4 tests) - DownloadProgress dataclass validation (1 test) - Custom exception handling (2 tests) - Authentication header generation (3 tests) - Session management (3 tests) ### Documentation - Update backend-testing-improvement-plan.md with Phase 1 completion status ## Test Results - All 458 service tests pass - No regressions introduced Relates to backend testing improvement plan Phase 1
This commit is contained in:
@@ -4,9 +4,13 @@ testpaths = tests
|
||||
python_files = test_*.py
|
||||
python_classes = Test*
|
||||
python_functions = test_*
|
||||
# Register async marker for coroutine-style tests
|
||||
# Asyncio configuration
|
||||
asyncio_mode = auto
|
||||
asyncio_default_fixture_loop_scope = function
|
||||
# Register markers
|
||||
markers =
|
||||
asyncio: execute test within asyncio event loop
|
||||
no_settings_dir_isolation: allow tests to use real settings paths
|
||||
integration: integration tests requiring external resources
|
||||
# Skip problematic directories to avoid import conflicts
|
||||
norecursedirs = .git .tox dist build *.egg __pycache__ py
|
||||
Reference in New Issue
Block a user