Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
gh-133982: Refer to implementation specific mocks
This code is picking up `MockRawIO` which is defined globally in the
module but these should use the mock specific to the I/O implementation
being tested.
  • Loading branch information
cmaloney committed Sep 2, 2025
commit 751788f0ce7de2b77103db5076c0a7e892a5465d
8 changes: 4 additions & 4 deletions Lib/test/test_io/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -2259,14 +2259,14 @@ def test_constructor_max_buffer_size_removal(self):
self.tp(self.MockRawIO(), self.MockRawIO(), 8, 12)

def test_constructor_with_not_readable(self):
class NotReadable(MockRawIO):
class NotReadable(self.MockRawIO):
def readable(self):
return False

self.assertRaises(OSError, self.tp, NotReadable(), self.MockRawIO())

def test_constructor_with_not_writeable(self):
class NotWriteable(MockRawIO):
class NotWriteable(self.MockRawIO):
def writable(self):
return False

Expand Down Expand Up @@ -2412,9 +2412,9 @@ def writer_close():
writer.close = lambda: None

def test_isatty(self):
class SelectableIsAtty(MockRawIO):
class SelectableIsAtty(self.MockRawIO):
def __init__(self, isatty):
MockRawIO.__init__(self)
super().__init__()
self._isatty = isatty

def isatty(self):
Expand Down
Loading