Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/python/cpython
/ woohoo
Method
woohoo
Lib/test/test_contextlib.py:75–78 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
73
state = []
74
@contextmanager
75
def
woohoo():
76
state.append(1)
77
yield
42
78
state.append(999)
79
with
woohoo()
as
x:
80
self.assertEqual(state, [1])
81
self.assertEqual(x, 42)
Callers
nothing calls this directly
Calls
5
assertIsNone
Method · 0.80
a
Class · 0.70
b
Function · 0.50
append
Method · 0.45
assertEqual
Method · 0.45
Tested by
no test coverage detected