Skip to content

Commit

Permalink
fixed path of rootdir for runner
Browse files Browse the repository at this point in the history
  • Loading branch information
smythi93 committed Aug 29, 2023
1 parent 1b2c5ec commit 8a80df6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sflkitlib>=0.0.1
astor>=0.8.1
numpy>=1.25.1
numpy>=1.25.2
matplotlib>=3.7.2
sortedcollections>=2.1.0
parameterized>=0.8.1
20 changes: 19 additions & 1 deletion src/sflkit/runners/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,24 @@ def __repr__(self):
return f"::{self.name}"


def split(s: str, sep: str = ",", esc: str = "\"'"):
values = list()
current = ""
escape = None
for c in s:
if c == escape:
escape = None
elif escape is None and c in esc:
escape = c
elif escape is None and c in sep:
values.append(current)
current = ""
continue
current += c
values.append(current)
return values


class PytestTree:
def __init__(self):
self.roots: List[PytestNode] = []
Expand All @@ -95,7 +113,7 @@ def parse(self, output: str, directory: Path = None):
directory = None if directory is None else directory.absolute()
for line in output.split("\n"):
if line.startswith("rootdir: ") and directory is not None:
root_dir = Path(line.replace("rootdir: ", "")).absolute()
root_dir = Path(split(line)[0].replace("rootdir: ", "")).absolute()
match = PYTEST_COLLECT_PATTERN.search(line)
if match:
level = self._count_spaces(line) // 2
Expand Down

0 comments on commit 8a80df6

Please sign in to comment.