Skip to content

Commit ca2b986

Browse files
committed
Use pathlib in hopes of resolving paths correctly on Windows
1 parent e5b2226 commit ca2b986

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

fortls/helper_functions.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,12 @@ def resolve_globs(glob_path: str, root_path: str = None) -> list[str]:
320320
--------
321321
322322
Relative to a root path
323-
>>> import os
324-
>>> resolve_globs('test', os.getcwd()) == [os.path.join(os.getcwd(), 'test')]
323+
>>> import os, pathlib
324+
>>> resolve_globs('test', os.getcwd()) == [str(pathlib.Path(os.getcwd()) / 'test')]
325325
True
326326
327327
Absolute path resolution
328-
>>> resolve_globs('test') == [os.path.join(os.getcwd(), 'test')]
328+
>>> resolve_globs('test') == [str(pathlib.Path(os.getcwd()) / 'test')]
329329
True
330330
"""
331331
# Resolve absolute paths i.e. not in our root_path

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ profile = "black"
1515

1616
[tool.pytest.ini_options]
1717
minversion = "7.0"
18-
addopts = "fortls test -v --cov=fortls --cov-report=html --cov-report=xml --cov-context=test --doctest-modules"
19-
testpaths = ["test"]
18+
addopts = "-v --cov=fortls --cov-report=html --cov-report=xml --cov-context=test --doctest-modules"
19+
testpaths = ["fortls", "test"]

0 commit comments

Comments
 (0)