diff --git a/hstest/testing/execution/searcher/base_searcher.py b/hstest/testing/execution/searcher/base_searcher.py index 71c44a86..d4501d52 100644 --- a/hstest/testing/execution/searcher/base_searcher.py +++ b/hstest/testing/execution/searcher/base_searcher.py @@ -253,11 +253,11 @@ def _parse_source(self, source: str) -> tuple[Path, Path, Module]: if source.name.endswith(ext): source_folder = None source_file = source - source_module = source[: -len(ext)].replace(os.sep, ".") + source_module = str(source)[:-len(ext)].replace(os.sep, ".") - elif os.sep in source: + elif os.sep in str(source): if source.name.endswith(os.sep): - source = source[: -len(os.sep)] + source = str(source)[:-len(os.sep)] source_folder = source source_file = None