MCPcopy Create free account
hub / github.com/MagicStack/contextvars / test_context_run_3

Method test_context_run_3

tests/test_basics.py:129–140  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

127 self.assertEqual(a, {})
128
129 def test_context_run_3(self):
130 ctx = contextvars.Context()
131
132 def func(*args, **kwargs):
133 1 / 0
134
135 with self.assertRaises(ZeroDivisionError):
136 ctx.run(func)
137 with self.assertRaises(ZeroDivisionError):
138 ctx.run(func, 1, 2)
139 with self.assertRaises(ZeroDivisionError):
140 ctx.run(func, 1, 2, a=123)
141
142 @isolated_context
143 def test_context_run_4(self):

Callers

nothing calls this directly

Calls 1

runMethod · 0.95

Tested by

no test coverage detected