(self)
| 733 | self.assertEqual(copysign(1., complex("-nan-nanj").imag), -1.) |
| 734 | |
| 735 | def test_underscores(self): |
| 736 | # check underscores |
| 737 | for lit in VALID_UNDERSCORE_LITERALS: |
| 738 | if not any(ch in lit for ch in 'xXoObB'): |
| 739 | self.assertEqual(complex(lit), eval(lit)) |
| 740 | self.assertEqual(complex(lit), complex(lit.replace('_', ''))) |
| 741 | for lit in INVALID_UNDERSCORE_LITERALS: |
| 742 | if lit in ('0_7', '09_99'): # octals are not recognized here |
| 743 | continue |
| 744 | if not any(ch in lit for ch in 'xXoObB'): |
| 745 | self.assertRaises(ValueError, complex, lit) |
| 746 | |
| 747 | def test_from_number(self, cls=complex): |
| 748 | def eq(actual, expected): |
nothing calls this directly
no test coverage detected