Plugin
pytest plugin hooks for pytest-agent-digest.
| CLASS | DESCRIPTION |
|---|---|
AgentDigestPlugin |
Internal plugin class that holds the per-session state. |
| FUNCTION | DESCRIPTION |
|---|---|
get_output_modes |
Return the set of output modes requested via --agent-digest. |
get_report_path |
Return the output path for the Markdown digest file. |
pytest_addoption |
Register pytest-agent-digest command-line options. |
pytest_configure |
Configure the pytest-agent-digest plugin. |
Classes¶
AgentDigestPlugin
¶
AgentDigestPlugin()
Internal plugin class that holds the per-session state.
Registered by pytest_configure so that pytest_runtest_logreport and
pytest_sessionfinish share the same ~pytest_agent_digest.collector.ReportCollector
without a global.
Initialize the plugin with a fresh collector.
| METHOD | DESCRIPTION |
|---|---|
pytest_runtest_logreport |
Forward each test report to the collector. |
pytest_sessionfinish |
Finalize the digest at the end of the test session. |
Functions¶
pytest_runtest_logreport
¶
pytest_runtest_logreport(report: TestReport) -> None
Forward each test report to the collector.
| PARAMETER | DESCRIPTION |
|---|---|
report
|
The test report for the current phase.
TYPE:
|
pytest_sessionfinish
¶
pytest_sessionfinish(session: Session, exitstatus: int) -> None
Finalize the digest at the end of the test session.
When term mode is active, renders the Markdown digest and prints it to stdout.
When file mode is active, writes the Markdown digest to disk and prints a confirmation line.
Both modes may be active simultaneously.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
The pytest session object.
TYPE:
|
exitstatus
|
The exit status code for the session.
TYPE:
|
Functions¶
get_output_modes
¶
get_report_path
¶
get_report_path(config: Config) -> Path
Return the output path for the Markdown digest file.
Resolution order:
--agent-digest-fileCLI flagagent_digest_fileini option- Hard-coded default
test-results.md
| PARAMETER | DESCRIPTION |
|---|---|
config
|
The pytest configuration object.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Path
|
A |
pytest_addoption
¶
pytest_addoption(parser: Parser) -> None
Register pytest-agent-digest command-line options.
| PARAMETER | DESCRIPTION |
|---|---|
parser
|
The pytest argument parser.
TYPE:
|
pytest_configure
¶
pytest_configure(config: Config) -> None
Configure the pytest-agent-digest plugin.
Instantiates the AgentDigestPlugin class and registers it so its hooks are active for the session.
When term mode is active, unregisters pytest's built-in terminal reporter so only the Markdown
digest appears on stdout.
Marked trylast=True so that the built-in terminal reporter is already registered by the time
this hook runs, making it safe to unregister.
| PARAMETER | DESCRIPTION |
|---|---|
config
|
The pytest configuration object.
TYPE:
|