test.support.EnvironmentVarGuard

class test.support.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 version 3.1: Added dictionary interface.

doc_python
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.