mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
* test: clean up test dirs Closes #1770. Partially does #1888. * dvc: close anything opened * test: finalize git repo explicitly to remove test dir later This was previously an issue on Windows.
17 lines
418 B
Python
17 lines
418 B
Python
import os
|
|
import pytest
|
|
|
|
from dvc.system import System
|
|
|
|
|
|
@pytest.mark.skipif(os.name != "nt", reason="Windows specific")
|
|
def test_getdirinfo(tmp_path):
|
|
# simulate someone holding an exclussive access
|
|
locked = str(tmp_path / "locked")
|
|
fd = os.open(locked, os.O_WRONLY | os.O_CREAT | os.O_EXCL)
|
|
try:
|
|
# should not raise WinError
|
|
System.getdirinfo(locked)
|
|
finally:
|
|
os.close(fd)
|