From e94e8fdaa60048f8784c53d53352bf6d8af9c7f0 Mon Sep 17 00:00:00 2001 From: LeSingh1 Date: Sat, 8 Aug 2026 19:08:39 -0700 Subject: [PATCH] Un-swap the pass_by_address parametrize ids in test_kernelParams @pytest.mark.parametrize("pass_by_address", [False, True], ids=["by-address", "not-by-address"]) pytest assigns ids to argvalues positionally, so pass_by_address=False gets the id "by-address" and pass_by_address=True gets "not-by-address". The body is unambiguous about which is which: ctypes.addressof(packagedParams) if pass_by_address else packagedParams True is the by-address case, so both ids name the opposite variant. Every failure report, -k selection and flake attribution for this test points at the wrong one. The neighbouring parametrize in the same file gets the mapping right (`[False, True]` with `ids=["no-ctypes", "ctypes"]`). Both branches still execute, so no code path was going untested; this is a labelling fix only, which is why there is no new test -- pytest's id assignment is what is being corrected, and `--collect-only` shows it directly. Applied to the legacy_api copy as well, so the two files stay consistent. --- cuda_bindings/tests/legacy_api/test_legacy_kernelParams.py | 2 +- cuda_bindings/tests/test_kernelParams.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cuda_bindings/tests/legacy_api/test_legacy_kernelParams.py b/cuda_bindings/tests/legacy_api/test_legacy_kernelParams.py index 555d6a7284c..60189cb08d2 100644 --- a/cuda_bindings/tests/legacy_api/test_legacy_kernelParams.py +++ b/cuda_bindings/tests/legacy_api/test_legacy_kernelParams.py @@ -601,7 +601,7 @@ class testStruct(ctypes.Structure): ASSERT_DRV(err) -@pytest.mark.parametrize("pass_by_address", [False, True], ids=["by-address", "not-by-address"]) +@pytest.mark.parametrize("pass_by_address", [False, True], ids=["not-by-address", "by-address"]) def test_kernelParams_buffer_protocol(pass_by_address, device): err, uvaSupported = cuda.cuDeviceGetAttribute( cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, device diff --git a/cuda_bindings/tests/test_kernelParams.py b/cuda_bindings/tests/test_kernelParams.py index 3457965086e..9f0ca4b7d66 100644 --- a/cuda_bindings/tests/test_kernelParams.py +++ b/cuda_bindings/tests/test_kernelParams.py @@ -583,7 +583,7 @@ class testStruct(ctypes.Structure): ASSERT_DRV(err) -@pytest.mark.parametrize("pass_by_address", [False, True], ids=["by-address", "not-by-address"]) +@pytest.mark.parametrize("pass_by_address", [False, True], ids=["not-by-address", "by-address"]) def test_kernelParams_buffer_protocol(pass_by_address, device): err, uvaSupported = cuda.cuDeviceGetAttribute( cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, device