Configuration
Overview
Section titled “Overview”TestingConfig extends BaseConfig from lexigram.config with environment prefix LEX_TESTING__. It controls test environment behavior.
from lexigram.testing.config import TestingConfig
# Defaultsconfig = TestingConfig()
# From YAMLconfig = TestingConfig.from_yaml("application.yaml")Options
Section titled “Options”| Key | Type | Default | Env Var | Description |
|---|---|---|---|---|
enabled | bool | True | LEX_TESTING__ENABLED | Whether testing module is enabled |
db_reuse | bool | True | LEX_TESTING__DB_REUSE | Reuse test databases between tests |
mock_external_services | bool | True | LEX_TESTING__MOCK_EXTERNAL_SERVICES | Mock external service calls |
cleanup_temp_files | bool | True | LEX_TESTING__CLEANUP_TEMP_FILES | Clean up temporary files after tests |
YAML Example
Section titled “YAML Example”testing: enabled: true db_reuse: true mock_external_services: false cleanup_temp_files: falseEnvironment Variables
Section titled “Environment Variables”export LEX_TESTING__ENABLED=trueexport LEX_TESTING__DB_REUSE=falseexport LEX_TESTING__MOCK_EXTERNAL_SERVICES=falseBest Practices
Section titled “Best Practices”- Use
mock_external_services: falsein integration test environments where real services are available - Disable
cleanup_temp_filesduring debugging to inspect generated artifacts - Override via environment variables in CI without modifying
application.yaml