Files
deb-python-eventlet/tests/isolated/patcher_blocking_select_methods_are_deleted.py
Jakub Stasiak 16aa6cb370 green selectors: Override DefaultSelector as well
The original patch[1] missed one thing which I just discovered - there's
selectors.DefaultSelector alias for the "the most efficient implementation
available on the current platform"[2].

Before this patch a non-green selector class would be obtained when
DefaultSelector was used.

[1] 0d509ef7d2
[2] https://docs.python.org/3.5/library/selectors.html#selectors.DefaultSelector
2016-01-11 22:25:15 +01:00

31 lines
881 B
Python

if __name__ == '__main__':
import eventlet
eventlet.monkey_patch()
# Leaving unpatched select methods in the select module is a recipe
# for trouble and this test makes sure we don't do that.
#
# Issues:
# * https://bitbucket.org/eventlet/eventlet/issues/167
# * https://github.com/eventlet/eventlet/issues/169
import select
for name in ['devpoll', 'poll', 'epoll', 'kqueue', 'kevent']:
assert not hasattr(select, name), name
import sys
if sys.version_info >= (3, 4):
import selectors
for name in [
'PollSelector',
'EpollSelector',
'DevpollSelector',
'KqueueSelector',
]:
assert not hasattr(selectors, name), name
default = selectors.DefaultSelector
assert default is selectors.SelectSelector, default
print('pass')