MCPcopy Create free account
hub / github.com/pytest-dev/pytest / break_getuser

Function break_getuser

testing/test_tmpdir.py:187–191  ·  view source on GitHub ↗
(monkeypatch)

Source from the content-addressed store, hash-verified

185
186@pytest.fixture
187def break_getuser(monkeypatch):
188 monkeypatch.setattr("os.getuid", lambda: -1)
189 # taken from python 2.7/3.4
190 for envvar in ("LOGNAME", "USER", "LNAME", "USERNAME"):
191 monkeypatch.delenv(envvar, raising=False)
192
193
194@pytest.mark.usefixtures("break_getuser")

Callers

nothing calls this directly

Calls 2

setattrMethod · 0.80
delenvMethod · 0.80

Tested by

no test coverage detected