Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in Pytest 5.4.x that was altering order of output lines.
Under pytest 5.4.x, failure reporting behavior considers all lines without a fail_marker prefix ("E") as a line of source code. These "source_lines" are grouped together regardless of their original position. Doing this can scramble the output when lines without a fail_marker appear after lines with a fail_marker. Normally, this causes no problems but when datatest removes fail_markers for "data differences", the output can be displayed out-of-order. The source of this behavior was introduced in pytest-dev/pytest@4209ad6 when addressing pytest-dev/pytest#6658. You can see the diff on GitHub: pytest-dev/pytest@4209ad6?branch=4209ad6fcacb679d953f3dd6be96f330139006f0&diff=split#diff-ac2099a172465905236568f8c175328fb75ebc1b80ce39f4799e61373d355418R1042 In later versions of Pytest, all lines after the first fail_marker are considered part of the error and the order of these lines is not altered--THIS IS THE DESIRED BEHAVIOR. See Pytest 6.1.1 source on GitHub: https://github.com/pytest-dev/pytest/blob/0ad20b533ffc52ced7bb1a03fba664615e90c093/src/_pytest/_code/code.py#L1059
- Loading branch information