API reference¶
This page is the quick reference for the public Python surface. For field-level config semantics, examples, and scope rules, read Configuration model. For hook ordering, read Lifecycle hooks.
Main import surface¶
from behave_toolkit import (
ConfigError,
DocumentationError,
DocumentationResult,
IntegrationError,
LifecycleManager,
LoggerSpec,
LoggingConfig,
ObjectSpec,
ParserConfig,
ParserTypeSpec,
Scope,
ToolkitConfig,
ToolkitError,
activate_feature_scope,
activate_global_scope,
activate_scenario_scope,
activate_scope,
configure_loggers,
configure_parsers,
configure_test_logging,
expand_scenario_cycles,
format_cycle_progress,
generate_step_docs,
get_cycle_progress,
install,
load_config,
load_yaml_file,
load_yaml_text,
substitute_feature_variables,
)
Configuration loading helpers¶
API |
Purpose |
|---|---|
|
Load toolkit config from one YAML file or a config directory. |
|
Load toolkit config from a YAML string. |
|
Normalize already-loaded mapping data into |
Installation and activation helpers¶
API |
Purpose |
Typical Behave hook |
|---|---|---|
|
Load and validate config, attach the manager, and activate global objects. |
|
|
Replace |
|
|
Expand tagged plain scenarios that use |
|
|
Configure Behave step matcher defaults and register custom types from YAML. |
module import time |
|
Configure one dedicated logger for a persistent test-run file plus optional console output. Recommended when one log file is enough. |
usually |
|
Configure all named loggers from the YAML |
usually |
|
Explicitly activate global objects. |
|
|
Activate feature-scoped objects. |
|
|
Activate scenario-scoped objects. |
|
|
Generic wrapper for scope activation. |
advanced usage |
Tip
The smallest recommended runtime path is install() plus the feature and scenario activation helpers. Add configure_test_logging() if you want one persistent suite log. Reach for configure_loggers() only when one file is no longer enough.
Documentation generation API¶
API |
Purpose |
|---|---|
|
Generate Sphinx-ready step/type reference pages from Python. Pass |
|
Return type exposing |
Cycle inspection helpers¶
API |
Purpose |
Typical use |
|---|---|---|
|
Return |
hook logic or assertions |
|
Return a display-ready label like |
logging and progress output |
Manager methods you will usually care about¶
Manager method |
Purpose |
|---|---|
|
Return configured object names. |
|
Return configured logger names from the |
|
Return the normalized |
|
Return an active instance by name. |
|
Return one configured active logger by name. |
|
List the object specs assigned to one scope. |
|
Inspect currently active instances for a scope. |
Public errors¶
Error |
Meaning |
|---|---|
|
Common base class for toolkit-specific failures. |
|
YAML loading or configuration validation failed. |
|
Hook wiring or Behave context integration failed. |
|
Step documentation generation failed. |