source#

source(name: str, *, when: str | dict[str, str] | None = None) None#

Source a shell rc file before a test is executed.

Usage#

.pyt:

import canary
canary.directives.source(name, when=...)

.vvt: NA

Parameters#

  • name: The name of the rc file

  • when: Restrict processing of the directive to this condition

Examples#

import sys
import canary
canary.directives.source("setup-env.sh")

will source the setup-env.sh file before the test is executed.