MCPcopy Index your code
hub / github.com/RustPython/RustPython / test___complex__

Method test___complex__

Lib/test/test_complex.py:637–644  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

635 self.assertRaises(TypeError, complex, complex2(1j))
636
637 def test___complex__(self):
638 z = 3 + 4j
639 self.assertEqual(z.__complex__(), z)
640 self.assertEqual(type(z.__complex__()), complex)
641
642 z = ComplexSubclass(3 + 4j)
643 self.assertEqual(z.__complex__(), 3 + 4j)
644 self.assertEqual(type(z.__complex__()), complex)
645
646 @support.requires_IEEE_754
647 def test_constructor_special_numbers(self):

Callers

nothing calls this directly

Calls 3

ComplexSubclassClass · 0.85
assertEqualMethod · 0.45
__complex__Method · 0.45

Tested by

no test coverage detected