PyDocs

Nav

Development Tools

EnvironmentVarGuard

Class used to temporarily set or unset environment variables. Instances can be used as a context manager and have a complete dictionary interface for querying/modifying the underlying os.environ. After exit from the context manager all changes to environment variables done through this instance will be rolled back.
Changed in 3.1
  • 3.1: Added dictionary interface.
Members of EnvironmentVarGuard

s

set
Temporarily set the environment variable envvar to the value of value.

u

unset
Temporarily unset one or more environment variables.
0 Examples
No examples for test.support.os_helper/EnvironmentVarGuard.
See Also
No see-alsos for test.support.os_helper/EnvironmentVarGuard
0 Notes
No notes for EnvironmentVarGuard