Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit f3505fd

Browse files
committed
fixed path for runner
1 parent 237225c commit f3505fd

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "sflkit"
10-
version = "0.2.7"
10+
version = "0.2.8"
1111
authors = [
1212
{ name = "Marius Smytzek", email = "marius.smytzek@cispa.de" },
1313
]

src/sflkit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from sflkit.config import Config, parse_config
77
from sflkit.instrumentation.dir_instrumentation import DirInstrumentation
88

9-
__version__ = "0.2.7"
9+
__version__ = "0.2.8"
1010

1111

1212
def instrument_config(conf: Config, event_dump: str = None):

src/sflkit/runners/run.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,23 @@ def _count_spaces(s: str):
9191
def parse(self, output: str, directory: Path = None):
9292
current_level = 0
9393
current_node = None
94+
root_dir = Path.cwd() if directory is None else directory
95+
directory = None if directory is None else directory.absolute()
9496
for line in output.split("\n"):
97+
if line.startswith("rootdir: ") and directory is not None:
98+
root_dir = Path(line.replace("rootdir: ", "")).absolute()
9599
match = PYTEST_COLLECT_PATTERN.search(line)
96100
if match:
97101
level = self._count_spaces(line) // 2
98102
name = match.group("name")
99103
if match.group("kind") == "Package":
100104
node_class = Package
101105
if directory:
102-
name = os.path.relpath(name, directory)
106+
name = str((root_dir / name).relative_to(directory))
103107
elif match.group("kind") == "Module":
104108
node_class = Module
105109
if directory:
106-
name = os.path.relpath(name, directory)
110+
name = str((root_dir / name).relative_to(directory))
107111
elif match.group("kind") in ("Class", "UnitTestCase"):
108112
node_class = Class
109113
elif match.group("kind") in ("Function", "TestCaseFunction"):

0 commit comments

Comments
 (0)