From e44eab760012ff6959269ac81184937ea74f1a92 Mon Sep 17 00:00:00 2001 From: KeynesYouDigit Date: Sat, 23 Nov 2024 15:12:50 -0700 Subject: [PATCH] use os path for path count --- tests/test_catalog.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_catalog.py b/tests/test_catalog.py index cb8bdace..12100b99 100644 --- a/tests/test_catalog.py +++ b/tests/test_catalog.py @@ -832,12 +832,18 @@ def test_generate_subcatalogs_works_for_subcatalogs_with_same_ids(self) -> None: assert len(result) == 6 catalog.normalize_hrefs("/") + for item in catalog.get_items(recursive=True): item_parent = item.get_parent() assert item_parent is not None parent_href = item_parent.self_href path_to_parent, _ = os.path.split(parent_href) - subcats = [el for el in path_to_parent.split("/") if el] + # subcats = [el for el in path_to_parent.split("/") if el] + subcats = list( + Path(path_to_parent).parts[1:] + ) # Skip drive letter if present (Windows) + + ## D: creates failure for py3.13 on windows assert len(subcats) == 2, f" for item '{item.id}'" def test_map_items(self) -> None: