gh-133982: Run unclosed file test on all io implementations by cmaloney · Pull Request #134165 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Lib/_pyio.py
4 changes: 2 additions & 2 deletions Lib/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4417,7 +4417,7 @@ def test_abc_inheritance_official(self):
self._check_abc_inheritance(io)

def _check_warn_on_dealloc(self, *args, **kwargs):
f = open(*args, **kwargs)
f = self.open(*args, **kwargs)
r = repr(f)
with self.assertWarns(ResourceWarning) as cm:
f = None
Expand Down Expand Up @@ -4446,7 +4446,7 @@ def cleanup_fds():
r, w = os.pipe()
fds += r, w
with warnings_helper.check_no_resource_warning(self):
open(r, *args, closefd=False, **kwargs)
self.open(r, *args, closefd=False, **kwargs)

@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
def test_warn_on_dealloc_fd(self):
Expand Down