Ejemplo n.º 1
0
def test_tpool_size():
    expected = '40'
    normal = '20'
    tests.run_isolated(
        path='env_tpool_size.py',
        env={'EVENTLET_THREADPOOL_SIZE': expected},
        args=[expected, normal],
    )
Ejemplo n.º 2
0
def test_tpool_size():
    expected = '40'
    normal = '20'
    tests.run_isolated(
        path='env_tpool_size.py',
        env={'EVENTLET_THREADPOOL_SIZE': expected},
        args=[expected, normal],
    )
Ejemplo n.º 3
0
def test_dns_methods_are_green():
    assert socket.gethostbyname is greendns.gethostbyname
    assert socket.gethostbyname_ex is greendns.gethostbyname_ex
    assert socket.getaddrinfo is greendns.getaddrinfo
    assert socket.getnameinfo is greendns.getnameinfo

    # https://github.com/eventlet/eventlet/pull/341
    # mock older dnspython in system packages
    mock_sys_pkg_dir = tempfile.mkdtemp('eventlet_test_dns_methods_are_green')
    try:
        with open(mock_sys_pkg_dir + '/dns.py', 'wb') as f:
            f.write(b'raise Exception("Your IP address string is so illegal ' +
                    b'it prevents installing packages.")\n')
        tests.run_isolated('socket_resolve_green.py', pythonpath_extend=[mock_sys_pkg_dir])
    finally:
        shutil.rmtree(mock_sys_pkg_dir)
Ejemplo n.º 4
0
def test_dns_methods_are_green():
    assert socket.gethostbyname is greendns.gethostbyname
    assert socket.gethostbyname_ex is greendns.gethostbyname_ex
    assert socket.getaddrinfo is greendns.getaddrinfo
    assert socket.getnameinfo is greendns.getnameinfo

    # https://github.com/eventlet/eventlet/pull/341
    # mock older dnspython in system packages
    mock_sys_pkg_dir = tempfile.mkdtemp('eventlet_test_dns_methods_are_green')
    try:
        with open(mock_sys_pkg_dir + '/dns.py', 'wb') as f:
            f.write(b'raise Exception("Your IP address string is so illegal ' +
                    b'it prevents installing packages.")\n')
        tests.run_isolated('socket_resolve_green.py',
                           pythonpath_extend=[mock_sys_pkg_dir])
    finally:
        shutil.rmtree(mock_sys_pkg_dir)
Ejemplo n.º 5
0
def test_tpool_zero():
    tests.run_isolated('env_tpool_zero.py', env={'EVENTLET_THREADPOOL_SIZE': '0'})
Ejemplo n.º 6
0
def test_import_patched_defaults():
    tests.run_isolated('patcher_import_patched_defaults.py')
Ejemplo n.º 7
0
def test_import_rdtypes_then_eventlet():
    # https://github.com/eventlet/eventlet/issues/479
    tests.run_isolated('greendns_import_rdtypes_then_eventlet.py')
Ejemplo n.º 8
0
def test_fork():
    tests.run_isolated('hub_fork.py')
Ejemplo n.º 9
0
def test_regular_file_readall():
    tests.run_isolated('regular_file_readall.py')
Ejemplo n.º 10
0
def test_threading_condition():
    tests.run_isolated('patcher_threading_condition.py')
Ejemplo n.º 11
0
def test_patcher_existing_locks_early():
    tests.run_isolated('patcher_existing_locks_early.py')
Ejemplo n.º 12
0
def test_regular_file_readall():
    tests.run_isolated('regular_file_readall.py')
Ejemplo n.º 13
0
def test_kqueue_unsupported():
    # https://github.com/eventlet/eventlet/issues/38
    # get_hub on windows broken by kqueue
    tests.run_isolated('hub_kqueue_unsupported.py')
Ejemplo n.º 14
0
def test_use_hub_class():
    tests.run_isolated('hub_use_hub_class.py')
Ejemplo n.º 15
0
def test_kqueue_unsupported():
    # https://github.com/eventlet/eventlet/issues/38
    # get_hub on windows broken by kqueue
    tests.run_isolated('hub_kqueue_unsupported.py')
Ejemplo n.º 16
0
def test_use_hub_class():
    tests.run_isolated('hub_use_hub_class.py')
Ejemplo n.º 17
0
def test_fork_simple():
    tests.run_isolated('hub_fork_simple.py')
Ejemplo n.º 18
0
def test_exception_identity():
    # https://github.com/eventlet/eventlet/issues/413
    # green module must keep exceptions classes as stdlib version
    tests.run_isolated('subprocess_exception_identity.py')
Ejemplo n.º 19
0
def test_isolate_from_socket_default_timeout():
    tests.run_isolated('tpool_isolate_socket_default_timeout.py', timeout=5)
Ejemplo n.º 20
0
def test_double_close_219():
    tests.run_isolated('greenio_double_close_219.py')
Ejemplo n.º 21
0
def test_patcher_existing_locks_unlocked():
    tests.run_isolated('patcher_existing_locks_unlocked.py')
Ejemplo n.º 22
0
def test_patcher_existing_locks_early():
    tests.run_isolated('patcher_existing_locks_early.py')
Ejemplo n.º 23
0
def test_socketserver_selectors():
    tests.run_isolated('patcher_socketserver_selectors.py')
Ejemplo n.º 24
0
def test_patcher_existing_locks_locked():
    tests.run_isolated('patcher_existing_locks_locked.py')
Ejemplo n.º 25
0
def test_threadpoolexecutor():
    tests.run_isolated('patcher_threadpoolexecutor.py')
Ejemplo n.º 26
0
 def test_monkey_patching(self):
     tests.run_isolated('mysqldb_monkey_patch.py')
Ejemplo n.º 27
0
def test_threading_current():
    tests.run_isolated('patcher_threading_current.py')
Ejemplo n.º 28
0
def test_isolate_from_socket_default_timeout():
    tests.run_isolated('tpool_isolate_socket_default_timeout.py', timeout=1)
Ejemplo n.º 29
0
def test_import_rdtypes_then_eventlet():
    # https://github.com/eventlet/eventlet/issues/479
    tests.run_isolated('greendns_import_rdtypes_then_eventlet.py')
Ejemplo n.º 30
0
def test_exception_leak():
    tests.run_isolated('tpool_exception_leak.py')
Ejemplo n.º 31
0
def test_tpool_negative():
    tests.run_isolated('env_tpool_negative.py', env={'EVENTLET_THREADPOOL_SIZE': '-1'})
Ejemplo n.º 32
0
def test_fork():
    tests.run_isolated('hub_fork.py')
Ejemplo n.º 33
0
def test_patched_communicate_290():
    # https://github.com/eventlet/eventlet/issues/290
    # Certain order of import and monkey_patch breaks subprocess communicate()
    # with AttributeError module `select` has no `poll` on Linux
    # unpatched methods are removed for safety reasons in commit f63165c0e3
    tests.run_isolated('subprocess_patched_communicate.py')
Ejemplo n.º 34
0
def test_fork_simple():
    tests.run_isolated('hub_fork_simple.py')
Ejemplo n.º 35
0
def test_double_close_219():
    tests.run_isolated('greenio_double_close_219.py')
Ejemplo n.º 36
0
def test_importlib_lock():
    tests.run_isolated('patcher_importlib_lock.py')
Ejemplo n.º 37
0
def test_exception_leak():
    tests.run_isolated('tpool_exception_leak.py')
Ejemplo n.º 38
0
def test_threading_condition():
    tests.run_isolated('patcher_threading_condition.py')
Ejemplo n.º 39
0
def test_patcher_existing_locks_late():
    tests.run_isolated('patcher_existing_locks_late.py')
Ejemplo n.º 40
0
def test_threading_join():
    tests.run_isolated('patcher_threading_join.py')
Ejemplo n.º 41
0
def test_importlib_lock():
    tests.run_isolated('patcher_importlib_lock.py')
Ejemplo n.º 42
0
def test_socketserver_selectors():
    tests.run_isolated('patcher_socketserver_selectors.py')
Ejemplo n.º 43
0
def test_threading_join():
    tests.run_isolated('patcher_threading_join.py')
Ejemplo n.º 44
0
def test_blocking_select_methods_are_deleted():
    tests.run_isolated('patcher_blocking_select_methods_are_deleted.py')
Ejemplo n.º 45
0
def test_blocking_select_methods_are_deleted():
    tests.run_isolated('patcher_blocking_select_methods_are_deleted.py')
Ejemplo n.º 46
0
def test_import_patched_handles_sub_modules():
    tests.run_isolated('test_sub_module_in_import_patched/test.py')
Ejemplo n.º 47
0
def test_threading_current():
    tests.run_isolated('patcher_threading_current.py')
Ejemplo n.º 48
0
def test_green_http_doesnt_change_original_module():
    tests.run_isolated('green_http_doesnt_change_original_module.py')
Ejemplo n.º 49
0
def test_import_patched_defaults():
    tests.run_isolated('patcher_import_patched_defaults.py')
Ejemplo n.º 50
0
def test_import_patched_handles_sub_modules():
    tests.run_isolated('test_sub_module_in_import_patched/test.py')
Ejemplo n.º 51
0
def test_reverse_name():
    tests.run_isolated('greendns_from_address_203.py')
Ejemplo n.º 52
0
def test_tpool_negative():
    tests.run_isolated('env_tpool_negative.py',
                       env={'EVENTLET_THREADPOOL_SIZE': '-1'})
Ejemplo n.º 53
0
def test_reverse_name():
    tests.run_isolated('greendns_from_address_203.py')
Ejemplo n.º 54
0
def test_tpool_zero():
    tests.run_isolated('env_tpool_zero.py',
                       env={'EVENTLET_THREADPOOL_SIZE': '0'})