Skip to content
GitHub

Configuration

TestingConfig extends BaseConfig from lexigram.config with environment prefix LEX_TESTING__. It controls test environment behavior.

from lexigram.testing.config import TestingConfig
# Defaults
config = TestingConfig()
# From YAML
config = TestingConfig.from_yaml("application.yaml")
KeyTypeDefaultEnv VarDescription
enabledboolTrueLEX_TESTING__ENABLEDWhether testing module is enabled
db_reuseboolTrueLEX_TESTING__DB_REUSEReuse test databases between tests
mock_external_servicesboolTrueLEX_TESTING__MOCK_EXTERNAL_SERVICESMock external service calls
cleanup_temp_filesboolTrueLEX_TESTING__CLEANUP_TEMP_FILESClean up temporary files after tests
application.yaml
testing:
enabled: true
db_reuse: true
mock_external_services: false
cleanup_temp_files: false
Terminal window
export LEX_TESTING__ENABLED=true
export LEX_TESTING__DB_REUSE=false
export LEX_TESTING__MOCK_EXTERNAL_SERVICES=false
  • Use mock_external_services: false in integration test environments where real services are available
  • Disable cleanup_temp_files during debugging to inspect generated artifacts
  • Override via environment variables in CI without modifying application.yaml