
green select: Delete unpatched poll once again https://github.com/eventlet/eventlet/pull/317 Previously attempted inf63165c
, had to be reverted in8ea9df6
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.
20 lines
485 B
Python
20 lines
485 B
Python
__test__ = False
|
|
|
|
if __name__ == '__main__':
|
|
import MySQLdb as m
|
|
from eventlet import patcher
|
|
from eventlet.green import MySQLdb as gm
|
|
patcher.monkey_patch(all=True, MySQLdb=True)
|
|
patched_set = set(patcher.already_patched) - set(['psycopg'])
|
|
assert patched_set == frozenset([
|
|
'MySQLdb',
|
|
'os',
|
|
'select',
|
|
'socket',
|
|
'subprocess',
|
|
'thread',
|
|
'time',
|
|
])
|
|
assert m.connect == gm.connect
|
|
print('pass')
|