File: patcher_blocking_select_methods_are_deleted.py

package info (click to toggle)
python-eventlet 0.40.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,200 kB
  • sloc: python: 25,101; sh: 78; makefile: 31
file content (31 lines) | stat: -rw-r--r-- 824 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
20
21
22
23
24
25
26
27
28
29
30
31
__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

    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')