MCPcopy
hub / github.com/MagicStack/asyncpg / test_record_gc

Method test_record_gc

tests/test_record.py:48–71  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

46 objs[i], after - before))
47
48 def test_record_gc(self):
49 elem = object()
50 mapping = {}
51 with self.checkref(mapping, elem):
52 r = Record(mapping, (elem,))
53 del r
54
55 key = 'spam'
56 val = int('101010')
57 mapping = {key: val}
58 with self.checkref(key, val):
59 r = Record(mapping, (0,))
60 with self.assertRaises(RuntimeError):
61 r[key]
62 del r
63
64 key = 'spam'
65 val = 'ham'
66 mapping = {key: val}
67 with self.checkref(key, val):
68 r = Record(mapping, (0,))
69 with self.assertRaises(RuntimeError):
70 r[key]
71 del r
72
73 def test_record_freelist_ok(self):
74 for _ in range(10000):

Callers

nothing calls this directly

Calls 1

checkrefMethod · 0.95

Tested by

no test coverage detected