MCPcopy 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

assertIsNoneMethod · 0.80
aClass · 0.70
bFunction · 0.50
appendMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected