Fixtures
provide.testkit.common.fixtures
¶
Common Test Fixtures for Foundation.
Provides pytest fixtures for capturing output, setting up telemetry, and other common testing scenarios across the Foundation test suite.
Classes¶
Functions¶
captured_stderr_for_foundation
¶
Fixture to capture stderr output from Foundation's logging system.
It redirects Foundation's log stream to an io.StringIO buffer, yields the buffer
to the test, and then restores the original stream.
Source code in provide/testkit/common/fixtures.py
mock_cache
¶
Mock cache object for testing.
Source code in provide/testkit/common/fixtures.py
mock_config_source
¶
mock_database
¶
Mock database connection for testing.
Source code in provide/testkit/common/fixtures.py
mock_event_emitter
¶
Mock event emitter for testing.
mock_file_system
¶
Mock file system for testing.
Source code in provide/testkit/common/fixtures.py
mock_http_config
¶
Mock HTTP configuration for testing.
mock_metrics_collector
¶
Mock metrics collector for testing.
Source code in provide/testkit/common/fixtures.py
mock_subprocess
¶
Mock subprocess for testing.
Source code in provide/testkit/common/fixtures.py
mock_telemetry_config
¶
Mock telemetry configuration for testing.
Source code in provide/testkit/common/fixtures.py
mock_transport
¶
Mock transport for testing.
Source code in provide/testkit/common/fixtures.py
setup_foundation_telemetry_for_test
¶
setup_foundation_telemetry_for_test(
captured_stderr_for_foundation: TextIO,
) -> Callable[[TelemetryConfig | None], None]
Fixture providing a function to set up Foundation Telemetry for tests.
This fixture captures stderr via captured_stderr_for_foundation
and provides a callable to configure telemetry with custom settings.