mirror of
https://github.com/p2p-ld/numpydantic.git
synced 2024-11-10 00:34:29 +00:00
windows doesn't like to let go of files
This commit is contained in:
parent
886cc893d8
commit
0a930eed35
1 changed files with 8 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
import shutil
|
import shutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Callable, Optional, Tuple, Type, Union
|
from typing import Any, Callable, Optional, Tuple, Type, Union
|
||||||
|
from warnings import warn
|
||||||
|
|
||||||
import h5py
|
import h5py
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -25,7 +26,13 @@ def tmp_output_dir(request: pytest.FixtureRequest) -> Path:
|
||||||
yield path
|
yield path
|
||||||
|
|
||||||
if not request.config.getvalue("--with-output"):
|
if not request.config.getvalue("--with-output"):
|
||||||
|
try:
|
||||||
shutil.rmtree(str(path))
|
shutil.rmtree(str(path))
|
||||||
|
except PermissionError as e:
|
||||||
|
# sporadic error on windows machines...
|
||||||
|
warn(
|
||||||
|
f"Temporary directory could not be removed due to a permissions error: \n{str(e)}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture(scope="function")
|
||||||
|
|
Loading…
Reference in a new issue