Skip to content

Commit

Permalink
Document evaluating complex number for infinity
Browse files Browse the repository at this point in the history
  • Loading branch information
AnjoMan committed Oct 25, 2019
1 parent 34a0212 commit 3c7fbe2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_pytest/python_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def __repr__(self):
"""

# Infinities aren't compared using tolerances, so don't show a
# tolerance.
# tolerance. Need to call abs to handle complex numbers, e.g. (inf + 1j)
if math.isinf(abs(self.expected)):
return str(self.expected)

Expand Down

0 comments on commit 3c7fbe2

Please sign in to comment.