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

Method test_copy_sign

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

Source from the content-addressed store, hash-verified

3178 self.assertRaises(TypeError, c.copy_negate, '-1')
3179
3180 def test_copy_sign(self):
3181 Decimal = self.decimal.Decimal
3182 Context = self.decimal.Context
3183
3184 c = Context()
3185 d = c.copy_sign(Decimal(1), Decimal(-2))
3186 self.assertEqual(c.copy_sign(1, -2), d)
3187 self.assertEqual(c.copy_sign(Decimal(1), -2), d)
3188 self.assertEqual(c.copy_sign(1, Decimal(-2)), d)
3189 self.assertRaises(TypeError, c.copy_sign, '1', -2)
3190 self.assertRaises(TypeError, c.copy_sign, 1, '-2')
3191
3192 def test_divide(self):
3193 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected