| 98 | |
| 99 | |
| 100 | def 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 | |
| 116 | def assert_pex_vars_hermetic(pex_disabled_variables=False): |