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

Function get_user

src/_pytest/tmpdir.py:158–166  ·  view source on GitHub ↗

Return the current user name, or None if getuser() does not work in the current environment (see #1010).

()

Source from the content-addressed store, hash-verified

156
157
158def get_user() -> Optional[str]:
159 """Return the current user name, or None if getuser() does not work
160 in the current environment (see #1010)."""
161 import getpass
162
163 try:
164 return getpass.getuser()
165 except (ImportError, KeyError):
166 return None
167
168
169def pytest_configure(config: Config) -> None:

Callers 3

test_get_userFunction · 0.90
getbasetempMethod · 0.85

Calls

no outgoing calls

Tested by 2

test_get_userFunction · 0.72