Skip to content

Commit

Permalink
Auto insert ^ and $ for "std{out,err} contains lines matching"
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-goode committed Dec 13, 2024
1 parent 30a9b41 commit 67b9daa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dnf-behave-tests/dnf/steps/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def then_stdout_contains_lines_matching(context):
test_lines = context.text.split('\n')
for line in test_lines:
for outline in out_lines:
if re.search(line.strip(), outline.strip()):
if re.search("^" + line.strip() + "$", outline.strip()):
break
else:
raise AssertionError("Stderr doesn't contain line matching: %s" % line)
Expand Down Expand Up @@ -321,7 +321,7 @@ def then_stderr_contains_lines_matching(context):
test_lines = context.text.split('\n')
for line in test_lines:
for outline in out_lines:
if re.search(line.strip(), outline.strip()):
if re.search("^" + line.strip() + "$", outline.strip()):
break
else:
raise AssertionError("Stderr doesn't contain line matching: %s" % line)
Expand Down

0 comments on commit 67b9daa

Please sign in to comment.