Kaydet (Commit) 581eb1e4 authored tarafından Armin Rigo's avatar Armin Rigo

Fix one of the tests: it relied on being present in an "output test" in

order to actually test what it was supposed to test, i.e. that the code
in the __del__ method did not crash.  Use instead the new helper
test_support.captured_output().
üst 260f5bae
...@@ -1136,14 +1136,10 @@ order (MRO) for bases """ ...@@ -1136,14 +1136,10 @@ order (MRO) for bases """
def __del__(self_): def __del__(self_):
self.assertEqual(self_.a, 1) self.assertEqual(self_.a, 1)
self.assertEqual(self_.b, 2) self.assertEqual(self_.b, 2)
with test_support.captured_output('stderr') as s:
save_stderr = sys.stderr h = H()
sys.stderr = sys.stdout
h = H()
try:
del h del h
finally: self.assertEqual(s.getvalue(), '')
sys.stderr = save_stderr
def test_slots_special(self): def test_slots_special(self):
# Testing __dict__ and __weakref__ in __slots__... # Testing __dict__ and __weakref__ in __slots__...
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment