Skip to content

Commit

Permalink
refactor(docs): update project image
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non committed Mar 17, 2017
1 parent ac068a8 commit 62cea96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. image:: http://i.imgur.com/BIcvhtP.jpg
.. image:: http://i.imgur.com/kKZPYut.jpg
:width: 100%
:alt: grappa logo
:align: center
Expand Down
15 changes: 14 additions & 1 deletion grappa/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,25 @@ def run(self, error):
if isinstance(expected, tuple) and len(expected) == 1:
expected = expected[0]

if isinstance(subject, str):
subject = subject.splitlines(1)
else:
subject = [subject]

if isinstance(expected, str):
expected = expected.splitlines(1)
else:
expected = [expected]

# Diff subject and expected values
data = list(difflib.ndiff([subject], [expected]))
data = list(difflib.ndiff(subject, expected))

# Remove trailing line feed
data[-1] = data[-1].replace(os.linesep, '')

# Normalize line separator with proper indent level
data = [i.replace(os.linesep, '') for i in data]

return data


Expand Down

0 comments on commit 62cea96

Please sign in to comment.