Commit d9bb37c
authored
tests: fix duplicate parametrization rejected by pytest 9.1.0 (#2227)
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
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 #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 #2226. Hunk body verified identical to the corresponding hunk in
#2212 (commit a9156b6).1 parent c5c1db1 commit d9bb37c
1 file changed
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
| 125 | + | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
| |||
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
261 | 265 | | |
262 | 266 | | |
263 | 267 | | |
264 | | - | |
265 | | - | |
| 268 | + | |
| 269 | + | |
266 | 270 | | |
267 | 271 | | |
268 | | - | |
| 272 | + | |
269 | 273 | | |
270 | 274 | | |
271 | 275 | | |
| |||
282 | 286 | | |
283 | 287 | | |
284 | 288 | | |
285 | | - | |
286 | | - | |
| 289 | + | |
| 290 | + | |
287 | 291 | | |
288 | 292 | | |
289 | | - | |
| 293 | + | |
290 | 294 | | |
291 | 295 | | |
292 | 296 | | |
| |||
0 commit comments