cuda-python icon indicating copy to clipboard operation
cuda-python copied to clipboard

`os.remove` on Windows could fail if files are still in use

Open leofang opened this issue 10 months ago • 0 comments

This code https://github.com/NVIDIA/cuda-python/blob/1c6f3bca5458bd4575ac77f7d77891a494b42faf/cuda_core/tests/conftest.py#L63-L66 could fail on Windows if the module is still loaded (and therefore the module file is in use):

On Windows, attempting to remove a file that is in use causes an exception to be raised

https://docs.python.org/3/library/os.html#os.remove

As per suggestion by @rwgk we should move cleanup code from test shutdown to test setup time.

leofang avatar Mar 25 '25 20:03 leofang