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

Method test_int

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

Source from the content-addressed store, hash-verified

24
25class TestNumbers(unittest.TestCase):
26 def test_int(self):
27 self.assertIsSubclass(int, Integral)
28 self.assertIsSubclass(int, Rational)
29 self.assertIsSubclass(int, Real)
30 self.assertIsSubclass(int, Complex)
31 self.assertIsSubclass(int, Number)
32
33 self.assertEqual(7, int(7).real)
34 self.assertEqual(0, int(7).imag)
35 self.assertEqual(7, int(7).conjugate())
36 self.assertEqual(-7, int(-7).conjugate())
37 self.assertEqual(7, int(7).numerator)
38 self.assertEqual(1, int(7).denominator)
39
40 def test_float(self):
41 self.assertNotIsSubclass(float, Integral)

Callers

nothing calls this directly

Calls 3

assertIsSubclassMethod · 0.45
assertEqualMethod · 0.45
conjugateMethod · 0.45

Tested by

no test coverage detected