Skip to content

Commit 12f3f9c

Browse files
committed
test improvemnet
1 parent 53f0083 commit 12f3f9c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Lib/test/test_cmath.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,14 +593,13 @@ def test_complex_special(self):
593593
special = [INF, -INF, NAN, 0.0, -0.0, 1.0]
594594
special_complex = [complex(x, y) for x in special for y in special]
595595

596-
nan_complex = [c for c in special_complex
597-
if cmath.isnan(c.real) or cmath.isnan(c.imag)]
596+
nan_complex = [c for c in special_complex if cmath.isnan(c)]
598597
for z in nan_complex:
599598
for w in special_complex:
600599
self.assertIsNotClose(z, w)
601600

602601
inf_complex = [c for c in special_complex
603-
if not cmath.isnan(c.real) and not cmath.isnan(c.imag)]
602+
if cmath.isinf(c) and not cmath.isnan(c)]
604603
for z in inf_complex:
605604
for w in inf_complex:
606605
if z != w:

0 commit comments

Comments
 (0)