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

Method test_copy

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

Source from the content-addressed store, hash-verified

4746 self.assertEqual(x.to_integral(), 2)
4747
4748 def test_copy(self):
4749 Context = self.decimal.Context
4750
4751 c = Context()
4752 c.prec = 10000
4753 x = -(1172 ** 1712)
4754
4755 y = c.copy_abs(x)
4756 self.assertEqual(y, -x)
4757
4758 y = c.copy_negate(x)
4759 self.assertEqual(y, -x)
4760
4761 y = c.copy_sign(x, 1)
4762 self.assertEqual(y, -x)
4763
4764@requires_cdecimal
4765class CCoverage(Coverage, unittest.TestCase):

Callers

nothing calls this directly

Calls 5

copy_absMethod · 0.95
copy_negateMethod · 0.95
copy_signMethod · 0.95
ContextClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected