artifact#
- artifact(file: str, *, when: str | dict[str, str] | None = None, upon: str = 'always') None#
Save
fileas an artifact. This directive is not used by the test directly. Reporters can save a test’s artifacts at their destination. For instance, the artifacts may submitted to CDash as part of the test submission.Usage#
.pyt:import canary canary.directives.artifact(file, *, when=..., upon=...)
.vvt:NAParameters#
when: Restrict processing of the directive to this conditionupon: Define when to save the artifact, based on the status of the job. *success: Save artifacts only when the job succeeds. *failure: Save artifacts only when the job fails or diffs. *always: Always save artifacts (except when jobs time out).
The
whenexpression is limited to the following conditions:testname: Restrict processing of the directive to this test nameplatforms: Restrict processing of the directive to certain platform or platformsoptions: Restrict processing of the directive to command line-ooptionsparameters: Restrict processing of the directive to certain parameter names and values
Examples#
import canary canary.directives.artifacts("file.txt", when="platforms='not darwin'", upon="success")