New Est Shizard hooks
Est Shizard new hooks specification. All new hooks must be prefixed with pytest_esh.
pytest_tw_modify_test_item_context #
Called during pytest_tw_setup_test_item to modify a test item context in the stash if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
pytest_tw_prepare_report_metadata #
Called during pytest_runtest_makereport to prepare a test item report metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
Returns:
| Type | Description |
|---|---|
dict | None
|
dict | None: test item report metadata |
pytest_tw_prepare_test_item_env #
Called during pytest_tw_setup_test_item to prepare a test item environment variables.
This env will be stashed in test item context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
Returns:
| Type | Description |
|---|---|
dict | None
|
dict | None: test item environment variables |
pytest_tw_prepare_test_item_repro_script #
Called during pytest_tw_setup_test_item to prepare a test item reproduction script.
The generated script will then be saved to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A test item reproduction script |
pytest_tw_run_fixture #
By default, Est Shizard currently uses the script_runner plugin to implement this hook.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixt_def
|
FixtureSpec
|
fixture definition |
required |
metadata
|
FixtureMetadata
|
fixture metadata |
required |
pytest_tw_run_fixture_form_assertion_message #
pytest_tw_run_fixture_form_assertion_message(
fixt_def: FixtureSpec, run_report: RunReport
) -> str | None
Called during pytest_tw_run_fixture to prepare a custom test item error message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixt_def
|
FixtureSpec
|
fixture definition |
required |
run_report
|
RunReport
|
(RunReport): run result |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: test item report metadata |
pytest_tw_run_fixture_process_artifacts #
Called during pytest_tw_run_fixture_protocol to perform artifacts processing
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixt_def
|
FixtureSpec
|
fixture definition |
required |
run_success
|
bool
|
run success marker |
required |
pytest_tw_run_fixture_process_log #
pytest_tw_run_fixture_process_log(
fixt_def: FixtureSpec,
metadata: FixtureMetadata,
config: Config,
) -> None
Called during pytest_tw_run_fixture_protocol to perform log processing
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixt_def
|
FixtureSpec
|
fixture definition |
required |
config
|
Config
|
|
required |
metadata
|
FixtureMetadata
|
fixture metadata |
required |
pytest_tw_run_fixture_protocol #
pytest_tw_run_fixture_protocol(
fixt_def: FixtureSpec,
metadata: FixtureMetadata,
config: Config,
) -> object | None
Called during exec_fixture from the FixtureCaller
Stops at first non-None result, see firstresult. The return value is not used, but only stops further processing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixt_def
|
FixtureSpec
|
fixture definition |
required |
metadata
|
FixtureMetadata
|
fixture metadata |
required |
config
|
Config
|
description |
required |
pytest_tw_run_test #
Called during pytest_tw_run_test_item_protocol to run the test for test item
Stops at first non-None result, see firstresult. The return value is not used, but only stops further processing.
By default, Est Shizard currently uses the script_runner plugin to implement this hook.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
pytest_tw_run_test_form_assertion_message #
Called during pytest_tw_run_test to prepare a custom test item error message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
run_report
|
RunReport
|
(RunReport): run result |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: test item report metadata |
pytest_tw_run_test_item_protocol #
Called during pytest_runtest_call from the test item description
to perform the Est Shizard's protocol for a single test item.
Stops at first non-None result, see firstresult. The return value is not used, but only stops further processing.
Used for
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
pytest_tw_run_test_process_artifacts #
Called during pytest_tw_run_test_item_protocol to perform artifacts processing
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
run_success
|
bool
|
run success marker |
required |
pytest_tw_run_test_process_log #
Called during pytest_tw_run_test_item_protocol to perform log processing
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
pytest_tw_setup_test_item #
Called during pytest.pytest_runtest_setup to perform the setup phase for Est Shizard test item
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
pytest_tw_setup_test_item_env #
Called during pytest_tw_setup_test_item to inject a test item environment variables in the environment.
The default implementation uses a pytest.MonkeyPatch object stashed in a test item context
to setup each variable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |
pytest_tw_teardown_test_item #
Called during pytest_runtest_teardown to perform the teardown phase for Est Shizard test item
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
|
required |