Silence ResourceWarning when testing that the file destructor closes the file.

This commit is contained in:
Brett Cannon 2010-10-29 23:53:03 +00:00
parent e1eca4e3f5
commit 5a9e91b050

View file

@ -461,6 +461,7 @@ class IOTest(unittest.TestCase):
def flush(self): def flush(self):
record.append(3) record.append(3)
super().flush() super().flush()
with support.check_warnings(('', ResourceWarning)):
f = MyFileIO(support.TESTFN, "wb") f = MyFileIO(support.TESTFN, "wb")
f.write(b"xxx") f.write(b"xxx")
del f del f