Skip to content

Commit 3f1ba96

Browse files
The-Compileryoutux
authored andcommitted
Fix gherkin terminal reporter test flakiness (#340)
The test compares the output of two different reporters and tries to account for the different runtime being printed. However, the output format changed with pytest v5.1.0: https://docs.pytest.org/en/latest/changelog.html#id76 This changes the regex to be a bit more permissive.
1 parent 76d4d87 commit 3f1ba96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/feature/test_gherkin_terminal_reporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ def output_must_be_the_same_as_regular_reporter(test_execution):
174174
assert ghe.ret == 0
175175
# last line can be different because of test execution time is printed
176176
reg_lines = reg.stdout.lines if reg.stdout.lines[-1] else reg.stdout.lines[:-2]
177-
reg_lines[-1] = re.sub(r" \d+\.\d+ ", " X ", reg_lines[-1])
177+
reg_lines[-1] = re.sub(r" in [^=]*", " in X ", reg_lines[-1])
178178
ghe_lines = ghe.stdout.lines if ghe.stdout.lines[-1] else ghe.stdout.lines[:-2]
179-
ghe_lines[-1] = re.sub(r" \d+\.\d+ ", " X ", ghe_lines[-1])
179+
ghe_lines[-1] = re.sub(r" in [^=]*", " in X ", ghe_lines[-1])
180180
for l1, l2 in zip(reg_lines, ghe_lines):
181181
assert l1 == l2
182182

0 commit comments

Comments
 (0)