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

Commit 8a80df6

Browse files
committed
fixed path of rootdir for runner
1 parent 1b2c5ec commit 8a80df6

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
sflkitlib>=0.0.1
22
astor>=0.8.1
3-
numpy>=1.25.1
3+
numpy>=1.25.2
44
matplotlib>=3.7.2
55
sortedcollections>=2.1.0
66
parameterized>=0.8.1

src/sflkit/runners/run.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,24 @@ def __repr__(self):
8080
return f"::{self.name}"
8181

8282

83+
def split(s: str, sep: str = ",", esc: str = "\"'"):
84+
values = list()
85+
current = ""
86+
escape = None
87+
for c in s:
88+
if c == escape:
89+
escape = None
90+
elif escape is None and c in esc:
91+
escape = c
92+
elif escape is None and c in sep:
93+
values.append(current)
94+
current = ""
95+
continue
96+
current += c
97+
values.append(current)
98+
return values
99+
100+
83101
class PytestTree:
84102
def __init__(self):
85103
self.roots: List[PytestNode] = []
@@ -95,7 +113,7 @@ def parse(self, output: str, directory: Path = None):
95113
directory = None if directory is None else directory.absolute()
96114
for line in output.split("\n"):
97115
if line.startswith("rootdir: ") and directory is not None:
98-
root_dir = Path(line.replace("rootdir: ", "")).absolute()
116+
root_dir = Path(split(line)[0].replace("rootdir: ", "")).absolute()
99117
match = PYTEST_COLLECT_PATTERN.search(line)
100118
if match:
101119
level = self._count_spaces(line) // 2

0 commit comments

Comments
 (0)