Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/pytest-dev/pytest
/ test_context_classmethod
Function
test_context_classmethod
testing/test_monkeypatch.py:442–449 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
440
441
442
def
test_context_classmethod() -> None:
443
class
A:
444
x = 1
445
446
with
MonkeyPatch.context()
as
m:
447
m.setattr(A,
"x"
, 2)
448
assert A.x == 2
449
assert A.x == 1
450
451
452
@pytest.mark.filterwarnings(
Callers
nothing calls this directly
Calls
2
context
Method · 0.80
setattr
Method · 0.80
Tested by
no test coverage detected