Skip to content

Commit 41b517d

Browse files
committed
Restore Windows guard; assert directory exists
1 parent 4284181 commit 41b517d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/functional/test_files.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,12 @@ def test_add_filepattern_from_dirname_recursive_nofwalk(client, cleanup_pins, mo
294294
assert conftest.sort_by_key(res) == conftest.sort_by_key(FAKE_DIR_FNPATTERN1_RECURSIVE_HASH)
295295

296296

297-
#@pytest.mark.skipif(not O_DIRECTORY,
298-
# reason="Opening directory FDs does not work on Windows")
297+
@pytest.mark.skipif(sys.platform.startswith("win"),
298+
reason="Opening directory FDs does not work on Windows")
299299
def test_add_filepattern_from_dirfd_recursive_nofwalk(client, cleanup_pins, monkeypatch):
300300
monkeypatch.setattr(ipfshttpclient.filescanner, "HAVE_FWALK", False)
301301

302-
if sys.platform.startswith("win"):
303-
os.mkdir(FAKE_DIR_PATH)
304-
assert os.path.isdir(FAKE_DIR_PATH)
302+
assert os.path.isdir(FAKE_DIR_PATH)
305303

306304
# On Windows, this line will fail with PermissionError: [Errno 13] Permission denied
307305
fd: int = os.open(str(FAKE_DIR_PATH), os.O_RDONLY | O_DIRECTORY)

0 commit comments

Comments
 (0)