Files
deb-python-eventlet/tests/isolated/mysqldb_monkey_patch.py
Sergey Shepelev 3316c6e9d1 tests/isolated for tests sandboxed in separate python process
API:
- write main test body into tests/isolated/filename.py
- it must write 'pass' to stdout or 'skip:[optional reason]'
- write a test with single line: tests.run_isolated('filename.py')
FIXME: autorun all files in tests/isolated

This deprecates tests.run_python and ProcessBase.
TODO: rewrite old multiline string test bodies to isolated files
TODO: add timeout to p.communicate() in run_python()
2015-02-25 00:23:11 +03:00

15 lines
488 B
Python

from __future__ import print_function
# no standard tests in this file, ignore
__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', 'thread', 'time'])
assert m.connect == gm.connect
print('pass')