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

Function test_context

testing/test_monkeypatch.py:401–410  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

399
400
401def test_context() -> None:
402 monkeypatch = MonkeyPatch()
403
404 import functools
405 import inspect
406
407 with monkeypatch.context() as m:
408 m.setattr(functools, "partial", 3)
409 assert not inspect.isclass(functools.partial)
410 assert inspect.isclass(functools.partial)
411
412
413def test_context_classmethod() -> None:

Callers

nothing calls this directly

Calls 3

contextMethod · 0.95
MonkeyPatchClass · 0.90
setattrMethod · 0.80

Tested by

no test coverage detected