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

Method test_copy

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

Source from the content-addressed store, hash-verified

3056 self.assertNotIn(Decimal(10), ['a', 1.0, (1,2), {}])
3057
3058 def test_copy(self):
3059 # All copies should be deep
3060 Decimal = self.decimal.Decimal
3061 Context = self.decimal.Context
3062
3063 c = Context()
3064 d = c.copy()
3065 self.assertNotEqual(id(c), id(d))
3066 self.assertNotEqual(id(c.flags), id(d.flags))
3067 self.assertNotEqual(id(c.traps), id(d.traps))
3068 k1 = set(c.flags.keys())
3069 k2 = set(d.flags.keys())
3070 self.assertEqual(k1, k2)
3071 self.assertEqual(c.flags, d.flags)
3072
3073 def test__clamp(self):
3074 # In Python 3.2, the private attribute `_clamp` was made

Callers

nothing calls this directly

Calls 7

copyMethod · 0.95
idFunction · 0.85
setFunction · 0.85
assertNotEqualMethod · 0.80
ContextClass · 0.70
keysMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected