Mocks
provide.testkit.logger.mocks
¶
Logger Mock Utilities for Testing.
Provides mock logger fixtures and factories for testing Foundation-based applications. These are logger-specific mocks that complement the Foundation reset orchestration.
Functions¶
mock_logger
¶
Comprehensive mock logger for testing.
Provides compatibility with both stdlib logging and structlog interfaces, including method call tracking and common logger attributes.
Returns:
| Type | Description |
|---|---|
Mock
|
Mock logger with debug, info, warning, error methods and structlog compatibility. |
Source code in provide/testkit/logger/mocks.py
mock_logger_factory
¶
Factory function to create mock loggers outside of pytest context.
Useful for unit tests that need a mock logger but aren't using pytest fixtures.
Returns:
| Type | Description |
|---|---|
Mock
|
Mock logger with the same interface as the pytest fixture. |