test(core,bindings): add mini parallel plugins in test conftests#2228
test(core,bindings): add mini parallel plugins in test conftests#2228seberg wants to merge 1 commit into
Conversation
Add lightweight pytest plugins in bindings/core conftest files to wrap parallel worker tests with CUDA context setup and fixture-aware initialization paths used by mini plugin execution.
|
gpt-5.5 PR 2228 FindingsReviewed PR 2228 ( FindingsHigh: per-worker CUDA fixture replacement mutates shared pytest-run-parallel kwargsFiles:
PR 2228 mutates Suggested fix if keeping this approach: copy first, mutate the copy, and call the test with the copy: call_kwargs = dict(kwargs)
# mutate call_kwargs only
return func(*args, **call_kwargs)Medium: bindings coverage misses
|
|
FWIW, I opened an issue on I don't think the code will get much shorter with that, but nicer/cleaner (and the threading part of the tests actually better). Although, now that I write that. A hook that runs during item collection and (may) return such a setup function may also work and would have the fixture information more naturally, I think. I suppose w.r.t. to this: I would probably rather stick with this unless we figure out a nicer patch to upstream. But we could do that. |
Add pytest plugins in bindings/core conftest files to wrap parallel worker tests with CUDA context setup and fixture-aware initialization paths used by mini plugin execution.
This can wait until the end, but I thought I'd split it out now since it is the most tedious part about
pytest-run-paralleltesting (beyond just churn) and more likely to need some iterations.(The plugin part runs fine locally so I think it can be merged; there is just a very small chance of follow-ups eventually since there are many test fixes. -- without using pytest-run-parallel this is dead-code beyond some fixture tweaks, though.)