tests: fix duplicate parametrization rejected by pytest 9.1.0 (#2212 backport)#2227
Merged
Merged
Conversation
Backport of NVIDIA#2212, scoped down to the cuda_bindings/tests/test_nvfatbin.py portion that applies to 12.9.x. The cuda_core/tests/test_utils.py portion of NVIDIA#2212 (the trailing-comma-in-parametrize-name fix) does not apply here because the 12.9.x version of that test file does not have the bug — its parametrize uses two names matching tuple values. What is fixed (verbatim from NVIDIA#2212): cuda_bindings/tests/test_nvfatbin.py had two tests using @pytest.mark.parametrize("arch", ["sm_80"], indirect=True) to override the fixture-level `arch` parametrization. pytest 9.1.0 now rejects this combination as "duplicate parametrization of 'arch'". Extract the CUBIN-building logic into a _build_cubin(arch) helper, drop the indirect override on the two tests, and call the helper inline with the hardcoded "sm_80" they need. Preserves intent (the override existed because target arch "75" must not match the CUBIN's arch). Closes NVIDIA#2226. Hunk body verified identical to the corresponding hunk in NVIDIA#2212 (commit a9156b6).
Contributor
Member
Author
|
/ok to test 2a66032 |
rwgk
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #2212, scoped down to the
cuda_bindings/tests/test_nvfatbin.pyportion that applies to 12.9.x.The
cuda_core/tests/test_utils.pyportion of #2212 (the trailing-comma-in-parametrize-name fix) does not apply here — the 12.9.x version of that file uses@pytest.mark.parametrize("in_arr,use_stream", (*gpu_array_samples(),))(two names matching tuple values), no stray comma.Hunk body verified identical to the corresponding hunk in #2212 (commit a9156b6).
Closes #2226.