MCPcopy
hub / github.com/pex-tool/pex / test_disable_patch

Function test_disable_patch

tests/test_variables.py:100–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99
100def test_disable_patch():
101 v = Variables(environ=dict(PEX_VERBOSE="42", PEX_PATH="other.pex:more.pex", PEX_SCRIPT="other"))
102 assert v.PEX_DISABLE_VARIABLES is False
103 assert 42 == v.PEX_VERBOSE
104 assert ("other.pex", "more.pex") == v.PEX_PATH
105 assert "other" == v.PEX_SCRIPT
106 assert v.PEX_EMIT_WARNINGS is None
107
108 with v.patch(PEX_DISABLE_VARIABLES="1", PEX_EMIT_WARNINGS="1"):
109 assert v.PEX_DISABLE_VARIABLES is True
110 assert 0 == v.PEX_VERBOSE
111 assert () == v.PEX_PATH
112 assert v.PEX_SCRIPT is None
113 assert v.PEX_EMIT_WARNINGS is None
114
115
116def assert_pex_vars_hermetic(pex_disabled_variables=False):

Callers

nothing calls this directly

Calls 2

patchMethod · 0.95
VariablesClass · 0.90

Tested by

no test coverage detected