Skip to content

Commit 3e6730b

Browse files
Aniketsyskirpichev
andauthored
Update Lib/test/test_cmath.py
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
1 parent 12f3f9c commit 3e6730b

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

Lib/test/test_cmath.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -590,18 +590,12 @@ def test_complex_special(self):
590590
self.assertIsNotClose(-INF, INF)
591591
self.assertIsNotClose(0, INF)
592592
self.assertIsNotClose(0, INF*1j)
593-
special = [INF, -INF, NAN, 0.0, -0.0, 1.0]
594-
special_complex = [complex(x, y) for x in special for y in special]
595-
596-
nan_complex = [c for c in special_complex if cmath.isnan(c)]
597-
for z in nan_complex:
598-
for w in special_complex:
593+
for z in complex_nans:
594+
for w in complex_infinities + complex_nans:
599595
self.assertIsNotClose(z, w)
600596

601-
inf_complex = [c for c in special_complex
602-
if cmath.isinf(c) and not cmath.isnan(c)]
603-
for z in inf_complex:
604-
for w in inf_complex:
597+
for z in complex_infinities:
598+
for w in complex_infinities:
605599
if z != w:
606600
self.assertIsNotClose(z, w)
607601
else:

0 commit comments

Comments
 (0)