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

Method test_context_getset_4

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

Source from the content-addressed store, hash-verified

291
292 @isolated_context
293 def test_context_getset_4(self):
294 c = contextvars.ContextVar('c', default=42)
295 ctx = contextvars.Context()
296
297 tok = ctx.run(c.set, 1)
298
299 with self.assertRaisesRegex(ValueError, 'different Context'):
300 c.reset(tok)
301
302 @isolated_context
303 def test_context_getset_5(self):

Callers

nothing calls this directly

Calls 2

runMethod · 0.95
resetMethod · 0.95

Tested by

no test coverage detected