xfail#
- xfail(*, code: int = -1, when: str | dict[str, str] | None = None) None#
The test is expected to fail (return with a non-zero exit code). If
code > 0and the exit code is notcode, the test will be considered to have failed.Usage#
.pyt:import canary canary.directives.xfail(code=-1, when=...)
Parameters#
code: The expected return code.-1considers any non-zero return code to be a pass.when: Restrict processing of the directive to this condition
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