diff options
author | Charles-François Natali <cf.natali@gmail.com> | 2014-03-24 22:25:39 (GMT) |
---|---|---|
committer | Charles-François Natali <cf.natali@gmail.com> | 2014-03-24 22:25:39 (GMT) |
commit | 1d29cc5b6c72afc8e310f99e8245de78493553b9 (patch) | |
tree | 7e1c8a2087a5c43b527c8203a67f31c1dc3dd388 /Lib/test/test_socketserver.py | |
parent | e3fb80fb7608538618d3cf731ff39c74a0faa651 (diff) | |
download | cpython-1d29cc5b6c72afc8e310f99e8245de78493553b9.zip cpython-1d29cc5b6c72afc8e310f99e8245de78493553b9.tar.gz cpython-1d29cc5b6c72afc8e310f99e8245de78493553b9.tar.bz2 |
Issue #21040: socketserver: Use the selectors module.
Diffstat (limited to 'Lib/test/test_socketserver.py')
-rw-r--r-- | Lib/test/test_socketserver.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index 0617b30..8e0fde4 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -222,38 +222,6 @@ class SocketServerTest(unittest.TestCase): socketserver.DatagramRequestHandler, self.dgram_examine) - @contextlib.contextmanager - def mocked_select_module(self): - """Mocks the select.select() call to raise EINTR for first call""" - old_select = select.select - - class MockSelect: - def __init__(self): - self.called = 0 - - def __call__(self, *args): - self.called += 1 - if self.called == 1: - # raise the exception on first call - raise OSError(errno.EINTR, os.strerror(errno.EINTR)) - else: - # Return real select value for consecutive calls - return old_select(*args) - - select.select = MockSelect() - try: - yield select.select - finally: - select.select = old_select - - def test_InterruptServerSelectCall(self): - with self.mocked_select_module() as mock_select: - pid = self.run_server(socketserver.TCPServer, - socketserver.StreamRequestHandler, - self.stream_examine) - # Make sure select was called again: - self.assertGreater(mock_select.called, 1) - # Alas, on Linux (at least) recvfrom() doesn't return a meaningful # client address so this cannot work: |