Skip to content

Commit

Permalink
Merge pull request #15 from tgs/fix-diff-line-formatting
Browse files Browse the repository at this point in the history
Fix formatting of diff lines
  • Loading branch information
nicoddemus authored Nov 20, 2018
2 parents baf2a14 + 193807b commit f64139b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.0.5 (2018-11-20)
------------------

* `#15 <https://github.com/ESSS/pytest-regressions/pull/15>`__: Remove some extra line separators from the diff output, which makes the representation more compact.

1.0.4 (2018-10-18)
------------------

Expand Down
4 changes: 3 additions & 1 deletion src/pytest_regressions/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def check_text_files(obtained_fn, expected_fn, fix_callback=lambda x: x, encodin
expected_lines = expected_fn.read_text(encoding=encoding).splitlines()

if obtained_lines != expected_lines:
diff_lines = list(difflib.unified_diff(expected_lines, obtained_lines))
diff_lines = list(
difflib.unified_diff(expected_lines, obtained_lines, lineterm="")
)
if len(diff_lines) <= 500:
html_fn = obtained_fn.with_suffix(".diff.html")
try:
Expand Down

0 comments on commit f64139b

Please sign in to comment.