Skip to content

Commit 49f4802

Browse files
Try not normalizing the path
1 parent ab4009a commit 49f4802

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tests/resources.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
RESOURCE_PATH = Path(__file__).parent / DATA_DIR / "data"
1717

1818

19-
def find(name: str) -> str:
20-
return os.path.normpath(os.path.join(os.path.dirname(__file__), DATA_DIR, name))
19+
def find(name: str, normpath: bool = True) -> str:
20+
path = os.path.join(os.path.dirname(__file__), DATA_DIR, name)
21+
if normpath:
22+
return os.path.normpath(path)
23+
return path
2124

2225

2326
def build_file(path: str, modname: str | None = None) -> Module:

tests/test_modutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def test_std_lib(self) -> None:
269269
)
270270

271271
def test_std_lib_found_before_same_named_package_on_path(self) -> None:
272-
sys.path.insert(0, resources.find("data"))
272+
sys.path.insert(0, resources.find("data", normpath=False))
273273
self.addCleanup(sys.path.pop, 0)
274274

275275
file = modutils.file_from_modpath(["copy"])

0 commit comments

Comments
 (0)