mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Silence ResourceWarning when testing that the file destructor closes the file.
This commit is contained in:
parent
e1eca4e3f5
commit
5a9e91b050
1 changed files with 8 additions and 7 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue