Skip to content

Commit 3c7fbe2

Browse files
committed
Document evaluating complex number for infinity
1 parent 34a0212 commit 3c7fbe2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_pytest/python_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def __repr__(self):
227227
"""
228228

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

0 commit comments

Comments
 (0)