Skip to content

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

@leofang

Description

@leofang

This code

try: # noqa: SIM105
os.remove(f)
except FileNotFoundError:
pass # noqa: SIM105

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.

Metadata

Metadata

Labels

P1Medium priority - Should docuda.coreEverything related to the cuda.core moduletestImprovements or additions to tests

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions