forked from iterative/dvc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: clean up test dirs (iterative#1904)
* test: clean up test dirs Closes iterative#1770. Partially does iterative#1888. * dvc: close anything opened * test: finalize git repo explicitly to remove test dir later This was previously an issue on Windows.
- Loading branch information
Showing
9 changed files
with
92 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import os | ||
import pytest | ||
|
||
from dvc.system import System | ||
from tests.basic_env import TestDir | ||
|
||
|
||
class TestSystem(TestDir): | ||
def test_getdirinfo(self): | ||
if os.name != "nt": | ||
return | ||
|
||
# simulate someone holding an exclussive access | ||
locked = "locked" | ||
fd = os.open(locked, os.O_WRONLY | os.O_CREAT | os.O_EXCL) | ||
|
||
@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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters