Skip to content

Commit 7e45902

Browse files
Keep popping current context until stack is drained for test_num_args_error_handling
1 parent 912ae11 commit 7e45902

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cuda_core/tests/test_module.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,12 @@ def test_num_args_error_handling(deinit_context_function, cuda12_prerequisite_ch
245245
)
246246
krn = mod.get_kernel("foo")
247247
# Unset current context using function from conftest
248-
deinit_context_function()
248+
while True:
249+
deinit_context_function()
250+
ctx = handle_return(driver.cuCtxGetCurrent())
251+
if int(ctx) == 0:
252+
# no active context, we are ready
253+
break
249254
# with no context, cuKernelGetParamInfo would report
250255
# exception which we expect to handle by raising
251256
with pytest.raises(CUDAError):

0 commit comments

Comments
 (0)