fix tests

This commit is contained in:
Manuel Barkhau 2020-10-04 21:17:20 +00:00
parent fd1b7bd05f
commit 2eb9b516b8
3 changed files with 47 additions and 29 deletions

View file

@ -180,7 +180,7 @@ def test(
def _grep_text(pattern: patterns.Pattern, text: str, color: bool) -> typ.Iterable[str]:
all_lines = text.splitlines()
all_lines = text.splitlines()
for match in pattern.regexp.finditer(text):
match_start, match_end = match.span()
@ -210,10 +210,7 @@ def _grep_text(pattern: patterns.Pattern, text: str, color: bool) -> typ.Iterabl
else:
lines[1] = matched_line
prefixed_lines = [
f"{lines_offset + i:>4}: {line}"
for i, line in enumerate(lines)
]
prefixed_lines = [f"{lines_offset + i:>4}: {line}" for i, line in enumerate(lines)]
yield "\n".join(prefixed_lines)

View file

@ -417,7 +417,7 @@ def parse(ctx: ProjectContext, cfg_missing_ok: bool = False) -> MaybeConfig:
def init(
project_path: typ.Union[str, pl.Path, None] = ".",
project_path : typ.Union[str, pl.Path, None] = ".",
cfg_missing_ok: bool = False,
) -> typ.Tuple[ProjectContext, MaybeConfig]:
ctx = init_project_ctx(project_path)