Skip to content

Commit

Permalink
Merge pull request #140 from gabrielfalcao/issue/139
Browse files Browse the repository at this point in the history
Remove wrong parens for format call. Closes #139.
  • Loading branch information
timofurrer committed Oct 2, 2017
2 parents cdf1ece + 15e9ac2 commit 5f544c6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sure/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def compare_floats(self, X, Y):
return True
else:
m = 'X{0}±{1} != Y{2}±{3}'.format(
(red(c.current_X_keys), self.epsilon, green(c.current_Y_keys), self.epsilon))
red(c.current_X_keys), self.epsilon, green(c.current_Y_keys), self.epsilon)
return DeepExplanation(m)

def compare_dicts(self, X, Y):
Expand Down
21 changes: 21 additions & 0 deletions tests/issues/test_issue_139.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-

"""
Test fix of bug described in GitHub Issue #139.
"""

from sure import expect


def test_issue_139():
"Test for GitHub Issue #139"
# test with big epsilon
expect(1.).should.equal(5., 4.)

# shouldn't raise IndexError: tuple index out of range
try:
expect(1.).should.equal(5., 3.)
except AssertionError:
pass
else:
raise RuntimeError('should not be equal')

0 comments on commit 5f544c6

Please sign in to comment.