#12788: fix error in test_policy when run under refleak detection

This commit is contained in:
R David Murray 2012-03-16 21:39:57 -04:00
parent 9a03ecfa50
commit 7104c7295c
1 changed files with 3 additions and 1 deletions

View File

@ -118,7 +118,9 @@ class PolicyAPITests(unittest.TestCase):
self.assertEqual(foo.defects, [defect1, defect2]) self.assertEqual(foo.defects, [defect1, defect2])
class MyPolicy(email.policy.Policy): class MyPolicy(email.policy.Policy):
defects = [] defects = None
def __init__(self, *args, **kw):
super().__init__(*args, defects=[], **kw)
def register_defect(self, obj, defect): def register_defect(self, obj, defect):
self.defects.append(defect) self.defects.append(defect)