Skip to content

Commit beb7f72

Browse files
committed
gh-300: Skip junction tests without _winapi
1 parent 09ff69f commit beb7f72

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎tests/test_fsutils.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import pytest
22
import shutil
3-
import _winapi
43

54
from copy import copy
65

76
from manage.exceptions import FilesInUseError
87
from manage.fsutils import atomic_unlink, ensure_tree, rmtree, unlink
98

9+
try:
10+
import _winapi
11+
except ImportError:
12+
_winapi = None
13+
1014
@pytest.fixture
1115
def tree(tmp_path):
1216
a = tmp_path / "a"
@@ -59,6 +63,7 @@ def test_rmtree(tree):
5963
assert not tree.exists()
6064

6165

66+
@pytest.mark.skipif(_winapi is None, reason="requires _winapi")
6267
def test_rmtree_junction(tmp_path):
6368
target = tmp_path / "target"
6469
target.mkdir()
@@ -73,6 +78,7 @@ def test_rmtree_junction(tmp_path):
7378
assert target_file.read_bytes() == b"preserve"
7479

7580

81+
@pytest.mark.skipif(_winapi is None, reason="requires _winapi")
7682
def test_rmtree_nested_junction(tmp_path):
7783
target = tmp_path / "target"
7884
target.mkdir()

0 commit comments

Comments
 (0)