Skip to content

tests: fix duplicate parametrization rejected by pytest 9.1.0 (#2212 backport)#2227

Merged
leofang merged 1 commit into
NVIDIA:12.9.xfrom
leofang:leofang/backport-2212-to-12.9.x
Jun 16, 2026
Merged

tests: fix duplicate parametrization rejected by pytest 9.1.0 (#2212 backport)#2227
leofang merged 1 commit into
NVIDIA:12.9.xfrom
leofang:leofang/backport-2212-to-12.9.x

Conversation

@leofang

@leofang leofang commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

Backport of #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 #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.

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).
@copy-pr-bot

copy-pr-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.bindings Everything related to the cuda.bindings module label Jun 15, 2026
@leofang

leofang commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

/ok to test 2a66032

@leofang leofang self-assigned this Jun 15, 2026
@leofang leofang added bug Something isn't working P0 High priority - Must do! test Improvements or additions to tests labels Jun 15, 2026
@leofang leofang added this to the cuda.bindings next milestone Jun 15, 2026
@leofang leofang marked this pull request as ready for review June 15, 2026 23:50
@leofang leofang enabled auto-merge (squash) June 15, 2026 23:50
@leofang leofang merged commit d9bb37c into NVIDIA:12.9.x Jun 16, 2026
125 of 127 checks passed
@leofang leofang deleted the leofang/backport-2212-to-12.9.x branch June 16, 2026 01:11
@leofang leofang linked an issue Jun 16, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.bindings Everything related to the cuda.bindings module P0 High priority - Must do! test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: pytest 9.1.0 breaks CI for the 12.9.x branch

2 participants