set_attribute#

set_attribute(*, when: str | dict[str, str] | None = None, **attributes: Any) None#

Set an attribute on the test

Usage#

.pyt:

import canary
canary.directives.set_attribute(*, when=..., **attributes)

.vvt: NA

Parameters#

  • when: Restrict processing of the directive to this condition

  • attributes: attr:value pairs

Examples#

import sys
import canary
canary.directives.set_attribute(program="program_name")

will set the attribute program on the job with value “program_name”.