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

Method test_float

Lib/test/test_abstract_numbers.py:40–50  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

38 self.assertEqual(1, int(7).denominator)
39
40 def test_float(self):
41 self.assertNotIsSubclass(float, Integral)
42 self.assertNotIsSubclass(float, Rational)
43 self.assertIsSubclass(float, Real)
44 self.assertIsSubclass(float, Complex)
45 self.assertIsSubclass(float, Number)
46
47 self.assertEqual(7.3, float(7.3).real)
48 self.assertEqual(0, float(7.3).imag)
49 self.assertEqual(7.3, float(7.3).conjugate())
50 self.assertEqual(-7.3, float(-7.3).conjugate())
51
52 def test_complex(self):
53 self.assertNotIsSubclass(complex, Integral)

Callers

nothing calls this directly

Calls 4

assertNotIsSubclassMethod · 0.45
assertIsSubclassMethod · 0.45
assertEqualMethod · 0.45
conjugateMethod · 0.45

Tested by

no test coverage detected