Environment

Environment variable mocking utilities for tests.

Helper methods for libtmux and downstream libtmux libraries.

class libtmux.test.environment.EnvironmentVarGuard[source]

Bases: object

Mock environmental variables safely.

Helps rotect the environment variable properly. Can be used as context manager.

Notes

Vendorized to fix issue with Anaconda Python 2 not including test module, see #121 [1]_

References

__init__()[source]
Return type:

None

set(envvar, value)[source]

Set environment variable.

Return type:

None

Parameters:
unset(envvar)[source]

Unset environment variable.

Return type:

None

Parameters:

envvar (str)