diff options
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r-- | Lib/test/test_descr.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 85df9dc..0e1f7c3 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1020,14 +1020,10 @@ order (MRO) for bases """ def __del__(self_): self.assertEqual(self_.a, 1) self.assertEqual(self_.b, 2) - - save_stderr = sys.stderr - sys.stderr = sys.stdout - h = H() - try: + with test_support.captured_output('stderr') as s: + h = H() del h - finally: - sys.stderr = save_stderr + self.assertEqual(s.getvalue(), '') def test_slots_special(self): # Testing __dict__ and __weakref__ in __slots__... |