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 protect the environment variable properly. Can be used as context manager.

Notes

Vendorized to fix issue with Anaconda Python 2 not including test module, see tmuxp#121.

__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)