Environment Variables for Unit Tests#

Several environment variables can be set to control the behavior of unit tests and to enable extra diagnostic output when debugging the library. They are grouped below by the component they affect.

Test-Runner Variables (yobx/ext_test_case.py)#

These variables are read by the helpers in yobx.ext_test_case and control which tests run and how their output is handled.

Variable

Default

Effect

UNITTEST_GOING

0

Set to 1 to signal that the test suite is actively running. Several tests use unit_test_going() to shorten expensive computations and skip slow branches.

UNHIDE

(unset)

Set to 1 (or True) to disable the hide_stdout() decorator so that standard output is not suppressed. Useful for inspecting print statements inside tests that are normally silenced.

LONGTEST

0

Set to 1 to enable tests decorated with long_test(). By default those tests are skipped.

NEVERTEST

0

Set to 1 to enable tests decorated with never_test(). By default those tests are always skipped.

VERBOSE

0

Integer verbosity level exposed via the verbose property. Tests may print additional diagnostic information when this value is greater than zero.

DEBUG

(unset)

Set to 1 (or True) to enable extra debug output in tests that check the debug property.

NOTORCH

0

Set to 1 to pretend that torch is not installed. Tests decorated with requires_torch() are skipped, and the builder switches to the pure-Python fallback path.

Other Variables#

Environment variables used by the graph builder, shape-inference engine, pattern optimizer, and PyTorch exporter are documented in the dedicated sections below: