As of pytest 9 with pytest-xdist, the subTest method of unittest.TestCase now runs subtests across processes. This creates a requirement that subtest inputs must be process-serializable, which isn't satisified for various numba types.
A solution to this problem is to move towards pytest.mark.parametrize, which has no such requirement. I looked at our subTest usage, and AFAICT all of it parametrizes over static values, meaning it's a straightforward conversion.
The annoying thing is pytest will not parametrize unittest.TestCase test methods subclasses, only methods of classes that are not subclasses of TestCase.
I think this means that we need to move away from TestCase subclasses entirely, and unittest as well.
I think we can do this by moving the CUDATestCase setup and teardown to session/module/function fixtures as needed, and move the methods that it has to top level functions that can be imported from conftest.py.
As of pytest 9 with
pytest-xdist, thesubTestmethod ofunittest.TestCasenow runs subtests across processes. This creates a requirement that subtest inputs must be process-serializable, which isn't satisified for various numba types.A solution to this problem is to move towards pytest.mark.parametrize, which has no such requirement. I looked at our subTest usage, and AFAICT all of it parametrizes over static values, meaning it's a straightforward conversion.
The annoying thing is pytest will not parametrize
unittest.TestCasetest methods subclasses, only methods of classes that are not subclasses ofTestCase.I think this means that we need to move away from TestCase subclasses entirely, and unittest as well.
I think we can do this by moving the
CUDATestCasesetup and teardown to session/module/function fixtures as needed, and move the methods that it has to top level functions that can be imported fromconftest.py.