Skip to content
3 changes: 3 additions & 0 deletions Lib/test/test_cmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,9 @@ def test_complex_near_zero(self):
self.assertIsNotClose(0.001-0.001j, 0.001+0.001j, abs_tol=1e-03)

def test_complex_special(self):
self.assertIsClose(complex(INF,INF),complex(INF,INF))
self.assertIsClose(complex(-INF,-INF),complex(-INF,-INF))
self.assertIsNotClose(complex(NAN,NAN),complex(NAN,NAN))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.assertIsClose(complex(INF,INF),complex(INF,INF))
self.assertIsClose(complex(-INF,-INF),complex(-INF,-INF))
self.assertIsNotClose(complex(NAN,NAN),complex(NAN,NAN))
self.assertIsClose(complex(INF, INF), complex(INF, INF))
self.assertIsClose(complex(-INF, -INF), complex(-INF, -INF))
self.assertIsNotClose(complex(NAN, NAN), complex(NAN, NAN))

self.assertIsNotClose(INF, INF*1j)
self.assertIsNotClose(INF*1j, INF)
self.assertIsNotClose(INF, -INF)
Expand Down
Loading