Commit a9156b6
authored
tests: fix parametrize patterns rejected by pytest 9.1.0 (#2212)
Two latent test-code bugs that older pytest tolerated but pytest 9.1.0
flags as collection errors, breaking every Test job on main since the
pytest 9.1.0 release:
* cuda_core/tests/test_utils.py:151 had a stray trailing comma in the
`parametrize` name string (`"in_arr,"`). pytest 9 now splits names on
comma and counts them, mismatching against the multi-element value
tuples. Drop the comma.
* 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 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).
Both fixes are pytest-version-agnostic; verified collecting cleanly
under pytest 9.1.0, 9.0.2, and 8.4.2 with minimal reproductions of
each pattern.1 parent ae1617d commit a9156b6
2 files changed
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
| 124 | + | |
126 | 125 | | |
127 | 126 | | |
128 | 127 | | |
| |||
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
| |||
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
262 | | - | |
263 | | - | |
| 266 | + | |
| 267 | + | |
264 | 268 | | |
265 | 269 | | |
266 | | - | |
| 270 | + | |
267 | 271 | | |
268 | 272 | | |
269 | 273 | | |
| |||
280 | 284 | | |
281 | 285 | | |
282 | 286 | | |
283 | | - | |
284 | | - | |
| 287 | + | |
| 288 | + | |
285 | 289 | | |
286 | 290 | | |
287 | | - | |
| 291 | + | |
288 | 292 | | |
289 | 293 | | |
290 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
0 commit comments