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

Method sub

tests/test_basics.py:344–349  ·  view source on GitHub ↗
(num)

Source from the content-addressed store, hash-verified

342 cvar = contextvars.ContextVar('cvar')
343
344 def sub(num):
345 for i in range(10):
346 cvar.set(num + i)
347 time.sleep(random.uniform(0.001, 0.05))
348 self.assertEqual(cvar.get(), num + i)
349 return num
350
351 tp = concurrent.futures.ThreadPoolExecutor(max_workers=10)
352 try:

Callers

nothing calls this directly

Calls 2

setMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected