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

Function concurrent_context2

numpy/core/tests/test_mem_policy.py:302–312  ·  view source on GitHub ↗
(get_module, orig_policy_name, event)

Source from the content-addressed store, hash-verified

300
301
302async def concurrent_context2(get_module, orig_policy_name, event):
303 await event.wait()
304 # the policy is not affected by changes in parallel contexts
305 assert np.core.multiarray.get_handler_name() == orig_policy_name
306 # change policy in the child context
307 if orig_policy_name == 'default_allocator':
308 get_module.set_secret_data_policy()
309 assert np.core.multiarray.get_handler_name() == 'secret_data_allocator'
310 else:
311 get_module.set_old_policy(None)
312 assert np.core.multiarray.get_handler_name() == 'default_allocator'
313
314
315async def async_test_context_locality(get_module):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected