MCPcopy Create free account
hub / github.com/numpy/numpy / async_test_context_locality

Function async_test_context_locality

numpy/core/tests/test_mem_policy.py:315–328  ·  view source on GitHub ↗
(get_module)

Source from the content-addressed store, hash-verified

313
314
315async def async_test_context_locality(get_module):
316 orig_policy_name = np.core.multiarray.get_handler_name()
317
318 event = asyncio.Event()
319 # the child contexts inherit the parent policy
320 concurrent_task1 = asyncio.create_task(
321 concurrent_context1(get_module, orig_policy_name, event))
322 concurrent_task2 = asyncio.create_task(
323 concurrent_context2(get_module, orig_policy_name, event))
324 await concurrent_task1
325 await concurrent_task2
326
327 # the parent context is not affected by child policy changes
328 assert np.core.multiarray.get_handler_name() == orig_policy_name
329
330
331@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils")

Callers 1

test_context_localityFunction · 0.85

Calls 2

concurrent_context1Function · 0.85
concurrent_context2Function · 0.85

Tested by

no test coverage detected