Files
deb-python-eventlet/tests/isolated/patcher_blocking_select_methods_are_deleted.py
Jakub Stasiak 614a20462a Remove select.poll and improve subprocess
green select: Delete unpatched poll once again

https://github.com/eventlet/eventlet/pull/317

Previously attempted in f63165c, had to be reverted in 8ea9df6 because
subprocess was failing after monkey patching.

Turns out we haven't been monkey patching the subprocess module at all,
this patch adds that in order for the tests to pass.

This part is changed because otherwise Popen class instantiation would
cause an infinite loop when monkey patching is applied:

    -subprocess_orig = __import__("subprocess")
    +subprocess_orig = patcher.original("subprocess")

This patch is contributed by Smarkets Limited.

* green subprocess: Provide green check_output

This patch is contributed by Smarkets Limited.
2016-05-20 13:23:36 +05:00

33 lines
899 B
Python

__test__ = False
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')