load_module#

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

Load a module before a test is executed.

Usage#

.pyt:

import canary
canary.directives.load_module(name, when=..., use=...)

.vvt: NA

Parameters#

  • name: The name of the module

  • use: Add this directory to MODULEPATH

  • when: Restrict processing of the directive to this condition

Examples#

import sys
import canary
canary.directives.load_module("gcc")

will load the gcc module before the test is executed.