Skip to content

Commit e44eab7

Browse files
use os path for path count
1 parent 3434620 commit e44eab7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_catalog.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,12 +832,18 @@ def test_generate_subcatalogs_works_for_subcatalogs_with_same_ids(self) -> None:
832832
assert len(result) == 6
833833

834834
catalog.normalize_hrefs("/")
835+
835836
for item in catalog.get_items(recursive=True):
836837
item_parent = item.get_parent()
837838
assert item_parent is not None
838839
parent_href = item_parent.self_href
839840
path_to_parent, _ = os.path.split(parent_href)
840-
subcats = [el for el in path_to_parent.split("/") if el]
841+
# subcats = [el for el in path_to_parent.split("/") if el]
842+
subcats = list(
843+
Path(path_to_parent).parts[1:]
844+
) # Skip drive letter if present (Windows)
845+
846+
## D: creates failure for py3.13 on windows
841847
assert len(subcats) == 2, f" for item '{item.id}'"
842848

843849
def test_map_items(self) -> None:

0 commit comments

Comments
 (0)