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

Method test_compare

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

Source from the content-addressed store, hash-verified

3108 self.assertRaises(TypeError, c.add, 1, '1')
3109
3110 def test_compare(self):
3111 Decimal = self.decimal.Decimal
3112 Context = self.decimal.Context
3113
3114 c = Context()
3115 d = c.compare(Decimal(1), Decimal(1))
3116 self.assertEqual(c.compare(1, 1), d)
3117 self.assertEqual(c.compare(Decimal(1), 1), d)
3118 self.assertEqual(c.compare(1, Decimal(1)), d)
3119 self.assertRaises(TypeError, c.compare, '1', 1)
3120 self.assertRaises(TypeError, c.compare, 1, '1')
3121
3122 def test_compare_signal(self):
3123 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected