File: mysqldb_monkey_patch.py

package info (click to toggle)
python-eventlet 0.26.1-7%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,916 kB
  • sloc: python: 24,898; makefile: 98
file content (19 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
__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')