From aca9f7c10938e4415e22c8c74ea934b1e055d7c2 Mon Sep 17 00:00:00 2001 From: manoj Date: Sun, 17 May 2026 16:56:35 +0530 Subject: [PATCH] Add edge case tests for isclose() function in test_cmath.py --- Lib/test/test_cmath.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py index a986fd6b892bd2..2de701f5fecc12 100644 --- a/Lib/test/test_cmath.py +++ b/Lib/test/test_cmath.py @@ -584,6 +584,10 @@ 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)) + self.assertIsNotClose(complex(INF, INF), complex(-INF, -INF)) self.assertIsNotClose(INF, INF*1j) self.assertIsNotClose(INF*1j, INF) self.assertIsNotClose(INF, -INF)