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

Function test_context

testing/test_monkeypatch.py:430–439  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

428
429
430def test_context() -> None:
431 monkeypatch = MonkeyPatch()
432
433 import functools
434 import inspect
435
436 with monkeypatch.context() as m:
437 m.setattr(functools, "partial", 3)
438 assert not inspect.isclass(functools.partial)
439 assert inspect.isclass(functools.partial)
440
441
442def 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