MCPcopy
hub / github.com/pytest-dev/pytest / delenv

Method delenv

src/_pytest/monkeypatch.py:328–335  ·  view source on GitHub ↗

Delete ``name`` from the environment. Raises ``KeyError`` if it does not exist, unless ``raising`` is set to False.

(self, name: str, raising: bool = True)

Source from the content-addressed store, hash-verified

326 self.setitem(os.environ, name, value)
327
328 def delenv(self, name: str, raising: bool = True) -> None:
329 """Delete ``name`` from the environment.
330
331 Raises ``KeyError`` if it does not exist, unless ``raising`` is set to
332 False.
333 """
334 environ: MutableMapping[str, str] = os.environ
335 self.delitem(environ, name, raising=raising)
336
337 def syspath_prepend(self, path) -> None:
338 """Prepend ``path`` to ``sys.path`` list of import locations."""

Callers 15

test_delenvFunction · 0.95
__init__Method · 0.80
test_xdist_normalMethod · 0.80
test_xdist_verboseMethod · 0.80
test_xdist_timesMethod · 0.80
test_xdist_normalMethod · 0.80
test_cache_reportheaderFunction · 0.80

Calls 1

delitemMethod · 0.95

Tested by 15

test_delenvFunction · 0.76
__init__Method · 0.64
test_xdist_normalMethod · 0.64
test_xdist_verboseMethod · 0.64
test_xdist_timesMethod · 0.64
test_xdist_normalMethod · 0.64
test_cache_reportheaderFunction · 0.64