@@ -184,6 +184,7 @@ def test_saxpy_arguments(get_saxpy_kernel, cuda12_prerequisite_check):
184184
185185 assert krn .num_arguments == 5
186186
187+ assert "ParamInfo" in str (type (krn ).arguments_info .fget .__annotations__ )
187188 arg_info = krn .arguments_info
188189 n_args = len (arg_info )
189190 assert n_args == krn .num_arguments
@@ -233,7 +234,7 @@ class ExpectedStruct(ctypes.Structure):
233234
234235
235236@skipif_testing_with_compute_sanitizer
236- def test_num_args_error_handling (deinit_cuda , cuda12_prerequisite_check ):
237+ def test_num_args_error_handling (deinit_context_function , cuda12_prerequisite_check ):
237238 if not cuda12_prerequisite_check :
238239 pytest .skip ("Test requires CUDA 12" )
239240 src = "__global__ void foo(int a) { }"
@@ -243,6 +244,10 @@ def test_num_args_error_handling(deinit_cuda, cuda12_prerequisite_check):
243244 name_expressions = ("foo" ,),
244245 )
245246 krn = mod .get_kernel ("foo" )
247+ # Unset current context using function from conftest
248+ deinit_context_function ()
249+ # with no context, cuKernelGetParamInfo would report
250+ # exception which we expect to handle by raising
246251 with pytest .raises (CUDAError ):
247252 # assignment resolves linter error "B018: useless expression"
248253 _ = krn .num_arguments
0 commit comments