MCPcopy Index your code
hub / github.com/python/cpython / test_same_quantum

Method test_same_quantum

Lib/test/test_decimal.py:3613–3623  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3611 self.assertRaises(TypeError, c.sqrt, '10')
3612
3613 def test_same_quantum(self):
3614 Decimal = self.decimal.Decimal
3615 Context = self.decimal.Context
3616
3617 c = Context()
3618 d = c.same_quantum(Decimal(1), Decimal(2))
3619 self.assertEqual(c.same_quantum(1, 2), d)
3620 self.assertEqual(c.same_quantum(Decimal(1), 2), d)
3621 self.assertEqual(c.same_quantum(1, Decimal(2)), d)
3622 self.assertRaises(TypeError, c.same_quantum, '1', 2)
3623 self.assertRaises(TypeError, c.same_quantum, 1, '2')
3624
3625 def test_scaleb(self):
3626 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

same_quantumMethod · 0.95
DecimalClass · 0.85
ContextClass · 0.70
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected