- Created ServiceConfig for dependency configuration - Created Abstract interfaces (Protocols) for mocking - Created MockPlayerRepository, MockTeamRepository, MockCacheService - Refactored BaseService and PlayerService to accept injectable dependencies - Added pytest configuration and unit tests - Tests can run without real database (uses mocks) Benefits: - Unit tests run in seconds without DB - Easy to swap implementations - Clear separation of concerns
10 lines
211 B
INI
10 lines
211 B
INI
[pytest]
|
|
testpaths = tests
|
|
python_files = test_*.py
|
|
python_classes = Test*
|
|
python_functions = test_*
|
|
addopts = -v --tb=short
|
|
filterwarnings =
|
|
ignore::DeprecationWarning
|
|
ignore::PendingDeprecationWarning
|