Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 627876 Details for
Bug 715584
dev-python/requests-2.23.0 fails 23 tests
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
build.log
requests-2.23.0:20200331-071817.log (text/plain), 150.79 KB, created by
ernsteiswuerfel
on 2020-03-31 07:36:17 UTC
(
hide
)
Description:
build.log
Filename:
MIME Type:
Creator:
ernsteiswuerfel
Created:
2020-03-31 07:36:17 UTC
Size:
150.79 KB
patch
obsolete
>[32;01m * [39;49;00mPackage: dev-python/requests-2.23.0 >[32;01m * [39;49;00mRepository: gentoo >[32;01m * [39;49;00mMaintainer: python@gentoo.org >[32;01m * [39;49;00mUSE: abi_ppc_64 elibc_glibc kernel_linux ppc64 python_targets_python2_7 python_targets_python3_6 ssl test userland_GNU >[32;01m * [39;49;00mFEATURES: network-sandbox preserve-libs sandbox test userpriv usersandbox >>>> Unpacking source... >>>> Unpacking requests-2.23.0.tar.gz to /var/tmp/portage/dev-python/requests-2.23.0/work >>>> Source unpacked in /var/tmp/portage/dev-python/requests-2.23.0/work >>>> Preparing source in /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0 ... >>>> Source prepared. >>>> Configuring source in /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0 ... >>>> Source configured. >>>> Compiling source in /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0 ... > [32;01m*[0m python2_7: running distutils-r1_run_phase distutils-r1_python_compile >python2.7 setup.py build >running build >running build_py >creating /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/cookies.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/__init__.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/status_codes.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/__version__.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/exceptions.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/utils.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/hooks.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/certs.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/auth.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/help.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/compat.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/_internal_utils.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/api.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/sessions.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/packages.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/structures.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/models.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >copying requests/adapters.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python2_7/lib/requests >running egg_info >writing requirements to requests.egg-info/requires.txt >writing requests.egg-info/PKG-INFO >writing top-level names to requests.egg-info/top_level.txt >writing dependency_links to requests.egg-info/dependency_links.txt >reading manifest file 'requests.egg-info/SOURCES.txt' >reading manifest template 'MANIFEST.in' >warning: no files found matching 'NOTICE' >warning: no files found matching 'requirements.txt' >writing manifest file 'requests.egg-info/SOURCES.txt' >warning: build_py: byte-compiling is disabled, skipping. > > [32;01m*[0m python3_6: running distutils-r1_run_phase distutils-r1_python_compile >python3.6 setup.py build -j 26 >running build >running build_py >creating /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/cookies.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/__init__.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/status_codes.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/__version__.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/exceptions.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/utils.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/hooks.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/certs.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/auth.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/help.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/compat.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/_internal_utils.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/api.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/sessions.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/packages.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/structures.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/models.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >copying requests/adapters.py -> /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0-python3_6/lib/requests >running egg_info >writing requests.egg-info/PKG-INFO >writing dependency_links to requests.egg-info/dependency_links.txt >writing requirements to requests.egg-info/requires.txt >writing top-level names to requests.egg-info/top_level.txt >reading manifest file 'requests.egg-info/SOURCES.txt' >reading manifest template 'MANIFEST.in' >warning: no files found matching 'NOTICE' >warning: no files found matching 'requirements.txt' >writing manifest file 'requests.egg-info/SOURCES.txt' >warning: build_py: byte-compiling is disabled, skipping. > >>>> Source compiled. >>>> Test phase: dev-python/requests-2.23.0 > [32;01m*[0m python2_7: running distutils-r1_run_phase python_test >========================================= test session starts ========================================== >platform linux2 -- Python 2.7.17, pytest-4.5.0, py-1.8.0, pluggy-0.13.1 -- /usr/bin/python2.7 >cachedir: .pytest_cache >rootdir: /var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0, inifile: pytest.ini >plugins: backports.unittest-mock-1.5, mock-1.11.2, rerunfailures-8.0, httpbin-1.0.0 >collecting ... collected 539 items > >tests/test_help.py::test_system_ssl PASSED [ 0%] >tests/test_help.py::test_idna_without_version_attribute PASSED [ 0%] >tests/test_help.py::test_idna_with_version_attribute PASSED [ 0%] >tests/test_hooks.py::test_hooks[hook-ata] PASSED [ 0%] >tests/test_hooks.py::test_hooks[hooks_list1-ta] PASSED [ 0%] >tests/test_hooks.py::test_default_hooks PASSED [ 1%] >tests/test_lowlevel.py::test_chunked_upload FAILED [ 1%] >tests/test_lowlevel.py::test_digestauth_401_count_reset_on_redirect FAILED [ 1%] >tests/test_lowlevel.py::test_digestauth_401_only_sent_once FAILED [ 1%] >tests/test_lowlevel.py::test_digestauth_only_on_4xx FAILED [ 1%] >tests/test_lowlevel.py::test_use_proxy_from_environment[http_proxy-http] FAILED [ 2%] >tests/test_lowlevel.py::test_use_proxy_from_environment[https_proxy-https] FAILED [ 2%] >tests/test_lowlevel.py::test_use_proxy_from_environment[all_proxy-http] FAILED [ 2%] >tests/test_lowlevel.py::test_use_proxy_from_environment[all_proxy-https] FAILED [ 2%] >tests/test_lowlevel.py::test_use_proxy_from_environment[HTTP_PROXY-http] FAILED [ 2%] >tests/test_lowlevel.py::test_use_proxy_from_environment[HTTPS_PROXY-https] FAILED [ 2%] >tests/test_lowlevel.py::test_use_proxy_from_environment[ALL_PROXY-http] FAILED [ 3%] >tests/test_lowlevel.py::test_use_proxy_from_environment[ALL_PROXY-https] FAILED [ 3%] >tests/test_lowlevel.py::test_redirect_rfc1808_to_non_ascii_location FAILED [ 3%] >tests/test_lowlevel.py::test_fragment_not_sent_with_request FAILED [ 3%] >tests/test_lowlevel.py::test_fragment_update_on_redirect FAILED [ 3%] >tests/test_packages.py::test_can_access_urllib3_attribute PASSED [ 4%] >tests/test_packages.py::test_can_access_idna_attribute PASSED [ 4%] >tests/test_packages.py::test_can_access_chardet_attribute PASSED [ 4%] >tests/test_requests.py::TestRequests::test_entry_points PASSED [ 4%] >tests/test_requests.py::TestRequests::test_invalid_url[MissingSchema-hiwpefhipowhefopw] PASSED [ 4%] >tests/test_requests.py::TestRequests::test_invalid_url[InvalidSchema-localhost:3128] PASSED [ 5%] >tests/test_requests.py::TestRequests::test_invalid_url[InvalidSchema-localhost.localdomain:3128/] PASSED [ 5%] >tests/test_requests.py::TestRequests::test_invalid_url[InvalidSchema-10.122.1.1:3128/] PASSED [ 5%] >tests/test_requests.py::TestRequests::test_invalid_url[InvalidURL-http://] PASSED [ 5%] >tests/test_requests.py::TestRequests::test_basic_building PASSED [ 5%] >tests/test_requests.py::TestRequests::test_no_content_length[GET] PASSED [ 5%] >tests/test_requests.py::TestRequests::test_no_content_length[HEAD] PASSED [ 6%] >tests/test_requests.py::TestRequests::test_no_body_content_length[POST] PASSED [ 6%] >tests/test_requests.py::TestRequests::test_no_body_content_length[PUT] PASSED [ 6%] >tests/test_requests.py::TestRequests::test_no_body_content_length[PATCH] PASSED [ 6%] >tests/test_requests.py::TestRequests::test_no_body_content_length[OPTIONS] PASSED [ 6%] >tests/test_requests.py::TestRequests::test_empty_content_length[POST] PASSED [ 7%] >tests/test_requests.py::TestRequests::test_empty_content_length[PUT] PASSED [ 7%] >tests/test_requests.py::TestRequests::test_empty_content_length[PATCH] PASSED [ 7%] >tests/test_requests.py::TestRequests::test_empty_content_length[OPTIONS] PASSED [ 7%] >tests/test_requests.py::TestRequests::test_override_content_length PASSED [ 7%] >tests/test_requests.py::TestRequests::test_path_is_not_double_encoded PASSED [ 7%] >tests/test_requests.py::TestRequests::test_params_are_added_before_fragment[http://example.com/path#fragment-http://example.com/path?a=b#fragment] PASSED [ 8%] >tests/test_requests.py::TestRequests::test_params_are_added_before_fragment[http://example.com/path?key=value#fragment-http://example.com/path?key=value&a=b#fragment] PASSED [ 8%] >tests/test_requests.py::TestRequests::test_params_original_order_is_preserved_by_default PASSED [ 8%] >tests/test_requests.py::TestRequests::test_params_bytes_are_encoded PASSED [ 8%] >tests/test_requests.py::TestRequests::test_binary_put PASSED [ 8%] >tests/test_requests.py::TestRequests::test_whitespaces_are_removed_from_url PASSED [ 9%] >tests/test_requests.py::TestRequests::test_mixed_case_scheme_acceptable[http://] PASSED [ 9%] >tests/test_requests.py::TestRequests::test_mixed_case_scheme_acceptable[HTTP://] PASSED [ 9%] >tests/test_requests.py::TestRequests::test_mixed_case_scheme_acceptable[hTTp://] 127.0.0.1 - - [31/Mar/2020 09:21:16] "GET /get HTTP/1.1" 200 134 >PASSED [ 9%] >tests/test_requests.py::TestRequests::test_mixed_case_scheme_acceptable[HttP://] PASSED [ 9%] >tests/test_requests.py::TestRequests::test_HTTP_200_OK_GET_ALTERNATIVE PASSED [ 10%] >tests/test_requests.py::TestRequests::test_HTTP_302_ALLOW_REDIRECT_GET PASSED [ 10%] >tests/test_requests.py::TestRequests::test_HTTP_307_ALLOW_REDIRECT_POST PASSED [ 10%] >tests/test_requests.py::TestRequests::test_HTTP_307_ALLOW_REDIRECT_POST_WITH_SEEKABLE PASSED [ 10%] >tests/test_requests.py::TestRequests::test_HTTP_302_TOO_MANY_REDIRECTS PASSED [ 10%] >tests/test_requests.py::TestRequests::test_HTTP_302_TOO_MANY_REDIRECTS_WITH_PARAMS PASSED [ 10%] >tests/test_requests.py::TestRequests::test_http_301_changes_post_to_get PASSED [ 11%] >tests/test_requests.py::TestRequests::test_http_301_doesnt_change_head_to_get PASSED [ 11%] >tests/test_requests.py::TestRequests::test_http_302_changes_post_to_get PASSED [ 11%] >tests/test_requests.py::TestRequests::test_http_302_doesnt_change_head_to_get PASSED [ 11%] >tests/test_requests.py::TestRequests::test_http_303_changes_post_to_get PASSED [ 11%] >tests/test_requests.py::TestRequests::test_http_303_doesnt_change_head_to_get PASSED [ 12%] >tests/test_requests.py::TestRequests::test_header_and_body_removal_on_redirect PASSED [ 12%] >tests/test_requests.py::TestRequests::test_transfer_enc_removal_on_redirect PASSED [ 12%] >tests/test_requests.py::TestRequests::test_fragment_maintained_on_redirect PASSED [ 12%] >tests/test_requests.py::TestRequests::test_HTTP_200_OK_GET_WITH_PARAMS PASSED [ 12%] >tests/test_requests.py::TestRequests::test_HTTP_200_OK_GET_WITH_MIXED_PARAMS PASSED [ 12%] >tests/test_requests.py::TestRequests::test_set_cookie_on_301 PASSED [ 13%] >tests/test_requests.py::TestRequests::test_cookie_sent_on_redirect 127.0.0.1 - - [31/Mar/2020 09:21:17] "GET /get HTTP/1.1" 200 237 >PASSED [ 13%] >tests/test_requests.py::TestRequests::test_cookie_removed_on_expire PASSED [ 13%] >tests/test_requests.py::TestRequests::test_cookie_quote_wrapped PASSED [ 13%] >tests/test_requests.py::TestRequests::test_cookie_persists_via_api PASSED [ 13%] >tests/test_requests.py::TestRequests::test_request_cookie_overrides_session_cookie 127.0.0.1 - - [31/Mar/2020 09:21:17] "GET /cookies HTTP/1.1" 200 26 >PASSED [ 14%] >tests/test_requests.py::TestRequests::test_request_cookies_not_persisted 127.0.0.1 - - [31/Mar/2020 09:21:17] "GET /cookies HTTP/1.1" 200 26 >PASSED [ 14%] >tests/test_requests.py::TestRequests::test_generic_cookiejar_works 127.0.0.1 - - [31/Mar/2020 09:21:17] "GET /cookies HTTP/1.1" 200 26 >PASSED [ 14%] >tests/test_requests.py::TestRequests::test_param_cookiejar_works 127.0.0.1 - - [31/Mar/2020 09:21:17] "GET /cookies HTTP/1.1" 200 26 >PASSED [ 14%] >tests/test_requests.py::TestRequests::test_cookielib_cookiejar_on_redirect PASSED [ 14%] >tests/test_requests.py::TestRequests::test_requests_in_history_are_not_overridden PASSED [ 15%] >tests/test_requests.py::TestRequests::test_history_is_always_a_list PASSED [ 15%] >tests/test_requests.py::TestRequests::test_headers_on_session_with_None_are_not_sent PASSED [ 15%] >tests/test_requests.py::TestRequests::test_headers_preserve_order PASSED [ 15%] >tests/test_requests.py::TestRequests::test_user_agent_transfers[User-agent] PASSED [ 15%] >tests/test_requests.py::TestRequests::test_user_agent_transfers[user-agent] PASSED [ 15%] >tests/test_requests.py::TestRequests::test_HTTP_200_OK_HEAD PASSED [ 16%] >tests/test_requests.py::TestRequests::test_HTTP_200_OK_PUT PASSED [ 16%] >tests/test_requests.py::TestRequests::test_BASICAUTH_TUPLE_HTTP_200_OK_GET PASSED [ 16%] >tests/test_requests.py::TestRequests::test_set_basicauth[user-pass] PASSED [ 16%] >tests/test_requests.py::TestRequests::test_set_basicauth[\xd0\xb8\xd0\xbc\xd1\x8f-\xd0\xbf\xd0\xb0\xd1\x80\xd0\xbe\xd0\xbb\xd1\x8c] PASSED [ 16%] >tests/test_requests.py::TestRequests::test_set_basicauth[42-42] PASSED [ 17%] >tests/test_requests.py::TestRequests::test_set_basicauth[None-None] PASSED [ 17%] >tests/test_requests.py::TestRequests::test_basicauth_encodes_byte_strings PASSED [ 17%] >tests/test_requests.py::TestRequests::test_errors[http://doesnotexist.google.com-ConnectionError] PASSED [ 17%] >tests/test_requests.py::TestRequests::test_errors[http://localhost:1-ConnectionError] PASSED [ 17%] >tests/test_requests.py::TestRequests::test_errors[http://fe80::5054:ff:fe5a:fc0-InvalidURL] PASSED [ 17%] >tests/test_requests.py::TestRequests::test_proxy_error PASSED [ 18%] >tests/test_requests.py::TestRequests::test_proxy_error_on_bad_url PASSED [ 18%] >tests/test_requests.py::TestRequests::test_basicauth_with_netrc PASSED [ 18%] >tests/test_requests.py::TestRequests::test_DIGEST_HTTP_200_OK_GET PASSED [ 18%] >tests/test_requests.py::TestRequests::test_DIGEST_AUTH_RETURNS_COOKIE PASSED [ 18%] >tests/test_requests.py::TestRequests::test_DIGEST_AUTH_SETS_SESSION_COOKIES PASSED [ 19%] >tests/test_requests.py::TestRequests::test_DIGEST_STREAM PASSED [ 19%] >tests/test_requests.py::TestRequests::test_DIGESTAUTH_WRONG_HTTP_401_GET PASSED [ 19%] >tests/test_requests.py::TestRequests::test_DIGESTAUTH_QUOTES_QOP_VALUE PASSED [ 19%] >tests/test_requests.py::TestRequests::test_POSTBIN_GET_POST_FILES PASSED [ 19%] >tests/test_requests.py::TestRequests::test_invalid_files_input PASSED [ 20%] >tests/test_requests.py::TestRequests::test_POSTBIN_SEEKED_OBJECT_WITH_NO_ITER PASSED [ 20%] >tests/test_requests.py::TestRequests::test_POSTBIN_GET_POST_FILES_WITH_DATA PASSED [ 20%] >tests/test_requests.py::TestRequests::test_post_with_custom_mapping PASSED [ 20%] >tests/test_requests.py::TestRequests::test_conflicting_post_params PASSED [ 20%] >tests/test_requests.py::TestRequests::test_request_ok_set PASSED [ 20%] >tests/test_requests.py::TestRequests::test_status_raising PASSED [ 21%] >tests/test_requests.py::TestRequests::test_decompress_gzip PASSED [ 21%] >tests/test_requests.py::TestRequests::test_unicode_get[/get-params0] PASSED [ 21%] >tests/test_requests.py::TestRequests::test_unicode_get[/get-params1] PASSED [ 21%] >tests/test_requests.py::TestRequests::test_unicode_get[/get-params2] PASSED [ 21%] >tests/test_requests.py::TestRequests::test_unicode_get[/get-params3] PASSED [ 22%] >tests/test_requests.py::TestRequests::test_unicode_get[\xc3\xb8-params4] PASSED [ 22%] >tests/test_requests.py::TestRequests::test_unicode_header_name PASSED [ 22%] >tests/test_requests.py::TestRequests::test_pyopenssl_redirect PASSED [ 22%] >tests/test_requests.py::TestRequests::test_invalid_ca_certificate_path PASSED [ 22%] >tests/test_requests.py::TestRequests::test_invalid_ssl_certificate_files PASSED [ 23%] >tests/test_requests.py::TestRequests::test_http_with_certificate PASSED [ 23%] >tests/test_requests.py::TestRequests::test_certificate_failure PASSED [ 23%] >tests/test_requests.py::TestRequests::test_urlencoded_get_query_multivalued_param PASSED [ 23%] >tests/test_requests.py::TestRequests::test_form_encoded_post_query_multivalued_element PASSED [ 23%] >tests/test_requests.py::TestRequests::test_different_encodings_dont_break_post PASSED [ 23%] >tests/test_requests.py::TestRequests::test_unicode_multipart_post[data0] PASSED [ 24%] >tests/test_requests.py::TestRequests::test_unicode_multipart_post[data1] PASSED [ 24%] >tests/test_requests.py::TestRequests::test_unicode_multipart_post[data2] PASSED [ 24%] >tests/test_requests.py::TestRequests::test_unicode_multipart_post[data3] PASSED [ 24%] >tests/test_requests.py::TestRequests::test_unicode_multipart_post_fieldnames PASSED [ 24%] >tests/test_requests.py::TestRequests::test_unicode_method_name PASSED [ 25%] >tests/test_requests.py::TestRequests::test_unicode_method_name_with_request_object PASSED [ 25%] >tests/test_requests.py::TestRequests::test_non_prepared_request_error PASSED [ 25%] >tests/test_requests.py::TestRequests::test_custom_content_type PASSED [ 25%] >tests/test_requests.py::TestRequests::test_hook_receives_request_arguments PASSED [ 25%] >tests/test_requests.py::TestRequests::test_session_hooks_are_used_with_no_request_hooks PASSED [ 25%] >tests/test_requests.py::TestRequests::test_session_hooks_are_overridden_by_request_hooks PASSED [ 26%] >tests/test_requests.py::TestRequests::test_prepared_request_hook PASSED [ 26%] >tests/test_requests.py::TestRequests::test_prepared_from_session PASSED [ 26%] >tests/test_requests.py::TestRequests::test_prepare_request_with_bytestring_url PASSED [ 26%] >tests/test_requests.py::TestRequests::test_request_with_bytestring_host PASSED [ 26%] >tests/test_requests.py::TestRequests::test_links PASSED [ 27%] >tests/test_requests.py::TestRequests::test_cookie_parameters PASSED [ 27%] >tests/test_requests.py::TestRequests::test_cookie_as_dict_keeps_len PASSED [ 27%] >tests/test_requests.py::TestRequests::test_cookie_as_dict_keeps_items PASSED [ 27%] >tests/test_requests.py::TestRequests::test_cookie_as_dict_keys PASSED [ 27%] >tests/test_requests.py::TestRequests::test_cookie_as_dict_values PASSED [ 28%] >tests/test_requests.py::TestRequests::test_cookie_as_dict_items PASSED [ 28%] >tests/test_requests.py::TestRequests::test_cookie_duplicate_names_different_domains PASSED [ 28%] >tests/test_requests.py::TestRequests::test_cookie_duplicate_names_raises_cookie_conflict_error PASSED [ 28%] >tests/test_requests.py::TestRequests::test_cookie_policy_copy PASSED [ 28%] >tests/test_requests.py::TestRequests::test_time_elapsed_blank PASSED [ 28%] >tests/test_requests.py::TestRequests::test_empty_response_has_content_none PASSED [ 29%] >tests/test_requests.py::TestRequests::test_response_is_iterable PASSED [ 29%] >tests/test_requests.py::TestRequests::test_response_decode_unicode PASSED [ 29%] >tests/test_requests.py::TestRequests::test_response_reason_unicode PASSED [ 29%] >tests/test_requests.py::TestRequests::test_response_reason_unicode_fallback PASSED [ 29%] >tests/test_requests.py::TestRequests::test_response_chunk_size_type PASSED [ 30%] >tests/test_requests.py::TestRequests::test_request_and_response_are_pickleable PASSED [ 30%] >tests/test_requests.py::TestRequests::test_prepared_request_is_pickleable PASSED [ 30%] >tests/test_requests.py::TestRequests::test_prepared_request_with_file_is_pickleable PASSED [ 30%] >tests/test_requests.py::TestRequests::test_prepared_request_with_hook_is_pickleable PASSED [ 30%] >tests/test_requests.py::TestRequests::test_cannot_send_unprepared_requests PASSED [ 30%] >tests/test_requests.py::TestRequests::test_http_error PASSED [ 31%] >tests/test_requests.py::TestRequests::test_session_pickling PASSED [ 31%] >tests/test_requests.py::TestRequests::test_fixes_1329 PASSED [ 31%] >tests/test_requests.py::TestRequests::test_uppercase_scheme_redirect PASSED [ 31%] >tests/test_requests.py::TestRequests::test_transport_adapter_ordering PASSED [ 31%] >tests/test_requests.py::TestRequests::test_session_get_adapter_prefix_matching PASSED [ 32%] >tests/test_requests.py::TestRequests::test_session_get_adapter_prefix_matching_mixed_case PASSED [ 32%] >tests/test_requests.py::TestRequests::test_session_get_adapter_prefix_matching_is_case_insensitive PASSED [ 32%] >tests/test_requests.py::TestRequests::test_header_remove_is_case_insensitive PASSED [ 32%] >tests/test_requests.py::TestRequests::test_params_are_merged_case_sensitive PASSED [ 32%] >tests/test_requests.py::TestRequests::test_long_authinfo_in_url PASSED [ 33%] >tests/test_requests.py::TestRequests::test_header_keys_are_native PASSED [ 33%] >tests/test_requests.py::TestRequests::test_header_validation PASSED [ 33%] >tests/test_requests.py::TestRequests::test_header_value_not_str PASSED [ 33%] >tests/test_requests.py::TestRequests::test_header_no_return_chars PASSED [ 33%] >tests/test_requests.py::TestRequests::test_header_no_leading_space PASSED [ 33%] >tests/test_requests.py::TestRequests::test_can_send_objects_with_files[foo0] PASSED [ 34%] >tests/test_requests.py::TestRequests::test_can_send_objects_with_files[foo1] PASSED [ 34%] >tests/test_requests.py::TestRequests::test_can_send_objects_with_files[files2] PASSED [ 34%] >tests/test_requests.py::TestRequests::test_can_send_file_object_with_non_string_filename PASSED [ 34%] >tests/test_requests.py::TestRequests::test_autoset_header_values_are_native PASSED [ 34%] >tests/test_requests.py::TestRequests::test_nonhttp_schemes_dont_check_URLs PASSED [ 35%] >tests/test_requests.py::TestRequests::test_auth_is_stripped_on_http_downgrade PASSED [ 35%] >tests/test_requests.py::TestRequests::test_auth_is_retained_for_redirect_on_host PASSED [ 35%] >tests/test_requests.py::TestRequests::test_should_strip_auth_host_change PASSED [ 35%] >tests/test_requests.py::TestRequests::test_should_strip_auth_http_downgrade PASSED [ 35%] >tests/test_requests.py::TestRequests::test_should_strip_auth_https_upgrade PASSED [ 35%] >tests/test_requests.py::TestRequests::test_should_strip_auth_port_change PASSED [ 36%] >tests/test_requests.py::TestRequests::test_should_strip_auth_default_port[https://example.com:443/foo-https://example.com/bar] PASSED [ 36%] >tests/test_requests.py::TestRequests::test_should_strip_auth_default_port[http://example.com:80/foo-http://example.com/bar] PASSED [ 36%] >tests/test_requests.py::TestRequests::test_should_strip_auth_default_port[https://example.com/foo-https://example.com:443/bar] PASSED [ 36%] >tests/test_requests.py::TestRequests::test_should_strip_auth_default_port[http://example.com/foo-http://example.com:80/bar] PASSED [ 36%] >tests/test_requests.py::TestRequests::test_manual_redirect_with_partial_body_read 127.0.0.1 - - [31/Mar/2020 09:21:19] "GET /get HTTP/1.1" 200 218 >PASSED [ 37%] >tests/test_requests.py::TestRequests::test_prepare_body_position_non_stream PASSED [ 37%] >tests/test_requests.py::TestRequests::test_rewind_body PASSED [ 37%] >tests/test_requests.py::TestRequests::test_rewind_partially_read_body PASSED [ 37%] >tests/test_requests.py::TestRequests::test_rewind_body_no_seek PASSED [ 37%] >tests/test_requests.py::TestRequests::test_rewind_body_failed_seek PASSED [ 38%] >tests/test_requests.py::TestRequests::test_rewind_body_failed_tell PASSED [ 38%] >tests/test_requests.py::TestRequests::test_redirect_with_wrong_gzipped_header PASSED [ 38%] >tests/test_requests.py::TestRequests::test_basic_auth_str_is_always_native[test-test-Basic dGVzdDp0ZXN0] PASSED [ 38%] >tests/test_requests.py::TestRequests::test_basic_auth_str_is_always_native[\xd0\xb8\xd0\xbc\xd1\x8f-\xd0\xbf\xd0\xb0\xd1\x80\xd0\xbe\xd0\xbb\xd1\x8c-Basic 0LjQvNGPOtC/0LDRgNC+0LvRjA==] PASSED [ 38%] >tests/test_requests.py::TestRequests::test_requests_history_is_saved PASSED [ 38%] >tests/test_requests.py::TestRequests::test_json_param_post_content_type_works PASSED [ 39%] >tests/test_requests.py::TestRequests::test_json_param_post_should_not_override_data_param PASSED [ 39%] >tests/test_requests.py::TestRequests::test_response_iter_lines PASSED [ 39%] >tests/test_requests.py::TestRequests::test_response_context_manager 127.0.0.1 - - [31/Mar/2020 09:21:19] "GET /stream/4 HTTP/1.1" 200 496 >PASSED [ 39%] >tests/test_requests.py::TestRequests::test_unconsumed_session_response_closes_connection 127.0.0.1 - - [31/Mar/2020 09:21:19] "GET /stream/4 HTTP/1.1" 200 744 >PASSED [ 39%]127.0.0.1 - - [31/Mar/2020 09:21:19] "GET /stream/4 HTTP/1.1" 500 59 >Traceback (most recent call last): > File "/usr/lib64/python2.7/SocketServer.py", line 293, in _handle_request_noblock >---------------------------------------- >Exception happened during processing of request from ('127.0.0.1', 45198) > > self.process_request(request, client_address) >tests/test_requests.py::TestRequests::test_response_iter_lines_reentrant File "/usr/lib64/python2.7/SocketServer.py", line 321, in process_request > self.finish_request(request, client_address) > self.finish() > File "/usr/lib64/python2.7/SocketServer.py", line 716, in finish > self.wfile.close() > File "/usr/lib64/python2.7/socket.py", line 283, in close > self.flush() > File "/usr/lib64/python2.7/socket.py", line 307, in flush > self._sock.sendall(view[write_offset:write_offset+buffer_size]) >error: [Errno 32] Broken pipe >XFAIL [ 40%] >tests/test_requests.py::TestRequests::test_session_close_proxy_clear PASSED [ 40%] >tests/test_requests.py::TestRequests::test_proxy_auth PASSED [ 40%] >tests/test_requests.py::TestRequests::test_proxy_auth_empty_pass PASSED [ 40%] >tests/test_requests.py::TestRequests::test_response_json_when_content_is_None PASSED [ 40%] >tests/test_requests.py::TestRequests::test_response_without_release_conn PASSED [ 41%] >tests/test_requests.py::TestRequests::test_empty_stream_with_auth_does_not_set_content_length_header PASSED [ 41%] >tests/test_requests.py::TestRequests::test_stream_with_auth_does_not_set_transfer_encoding_header PASSED [ 41%] >tests/test_requests.py::TestRequests::test_chunked_upload_does_not_set_content_length_header PASSED [ 41%] >tests/test_requests.py::TestRequests::test_custom_redirect_mixin PASSED [ 41%] >tests/test_requests.py::TestCaseInsensitiveDict::test_init[cid0] PASSED [ 41%] >tests/test_requests.py::TestCaseInsensitiveDict::test_init[cid1] PASSED [ 42%] >tests/test_requests.py::TestCaseInsensitiveDict::test_init[cid2] PASSED [ 42%] >tests/test_requests.py::TestCaseInsensitiveDict::test_docstring_example PASSED [ 42%] >tests/test_requests.py::TestCaseInsensitiveDict::test_len PASSED [ 42%] >tests/test_requests.py::TestCaseInsensitiveDict::test_getitem PASSED [ 42%] >tests/test_requests.py::TestCaseInsensitiveDict::test_fixes_649 PASSED [ 43%] >tests/test_requests.py::TestCaseInsensitiveDict::test_delitem PASSED [ 43%] >tests/test_requests.py::TestCaseInsensitiveDict::test_contains PASSED [ 43%] >tests/test_requests.py::TestCaseInsensitiveDict::test_get PASSED [ 43%] >tests/test_requests.py::TestCaseInsensitiveDict::test_update PASSED [ 43%] >tests/test_requests.py::TestCaseInsensitiveDict::test_update_retains_unchanged PASSED [ 43%] >tests/test_requests.py::TestCaseInsensitiveDict::test_iter PASSED [ 44%] >tests/test_requests.py::TestCaseInsensitiveDict::test_equality PASSED [ 44%] >tests/test_requests.py::TestCaseInsensitiveDict::test_setdefault PASSED [ 44%] >tests/test_requests.py::TestCaseInsensitiveDict::test_lower_items PASSED [ 44%] >tests/test_requests.py::TestCaseInsensitiveDict::test_preserve_key_case PASSED [ 44%] >tests/test_requests.py::TestCaseInsensitiveDict::test_preserve_last_key_case PASSED [ 45%] >tests/test_requests.py::TestCaseInsensitiveDict::test_copy PASSED [ 45%] >tests/test_requests.py::TestMorselToCookieExpires::test_expires_valid_str PASSED [ 45%] >tests/test_requests.py::TestMorselToCookieExpires::test_expires_invalid_int[100-TypeError] PASSED [ 45%] >tests/test_requests.py::TestMorselToCookieExpires::test_expires_invalid_int[woops-ValueError] PASSED [ 45%] >tests/test_requests.py::TestMorselToCookieExpires::test_expires_none PASSED [ 46%] >tests/test_requests.py::TestMorselToCookieMaxAge::test_max_age_valid_int PASSED [ 46%] >tests/test_requests.py::TestMorselToCookieMaxAge::test_max_age_invalid_str PASSED [ 46%] >tests/test_requests.py::TestTimeout::test_stream_timeout PASSED [ 46%] >tests/test_requests.py::TestTimeout::test_invalid_timeout[timeout0-(connect, read)] PASSED [ 46%] >tests/test_requests.py::TestTimeout::test_invalid_timeout[foo-must be an int, float or None] PASSED [ 46%] >tests/test_requests.py::TestTimeout::test_none_timeout[None] PASSED [ 47%] >tests/test_requests.py::TestTimeout::test_none_timeout[timeout1] PASSED [ 47%] >tests/test_requests.py::TestTimeout::test_read_timeout[timeout0] PASSED [ 47%] >tests/test_requests.py::TestTimeout::test_read_timeout[timeout1] PASSED [ 47%] >tests/test_requests.py::TestTimeout::test_encoded_methods PASSED [ 47%] >tests/test_requests.py::test_json_encodes_as_bytes PASSED [ 48%] >tests/test_requests.py::test_requests_are_updated_each_time PASSED [ 48%] >tests/test_requests.py::test_proxy_env_vars_override_default[http_proxy-http://example.com-socks5://proxy.com:9876] PASSED [ 48%] >tests/test_requests.py::test_proxy_env_vars_override_default[https_proxy-https://example.com-socks5://proxy.com:9876] PASSED [ 48%] >tests/test_requests.py::test_proxy_env_vars_override_default[all_proxy-http://example.com-socks5://proxy.com:9876] PASSED [ 48%] >tests/test_requests.py::test_proxy_env_vars_override_default[all_proxy-https://example.com-socks5://proxy.com:9876] PASSED [ 48%] >tests/test_requests.py::test_data_argument_accepts_tuples[data0] PASSED [ 49%] >tests/test_requests.py::test_data_argument_accepts_tuples[data1] PASSED [ 49%] >tests/test_requests.py::test_data_argument_accepts_tuples[data2] PASSED [ 49%] >tests/test_requests.py::test_prepared_copy[None] PASSED [ 49%] >tests/test_requests.py::test_prepared_copy[kwargs1] PASSED [ 49%] >tests/test_requests.py::test_prepared_copy[kwargs2] PASSED [ 50%] >tests/test_requests.py::test_prepared_copy[kwargs3] PASSED [ 50%] >tests/test_requests.py::test_urllib3_retries PASSED [ 50%] >tests/test_requests.py::test_urllib3_pool_connection_closed PASSED [ 50%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://google.com-http://google.com/] PASSED [ 50%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://\u30b8\u30a7\u30fc\u30d4\u30fc\u30cb\u30c3\u30af.jp-http://xn--hckqz9bzb1cyrb.jp/] PASSED [ 51%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://xn--n3h.net/-http://xn--n3h.net/0] PASSED [ 51%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://\xe3\x82\xb8\xe3\x82\xa7\xe3\x83\xbc\xe3\x83\x94\xe3\x83\xbc\xe3\x83\x8b\xe3\x83\x83\xe3\x82\xaf.jp-http://xn--hckqz9bzb1cyrb.jp/] PASSED [ 51%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://stra\xdfe.de/stra\xdfe-http://xn--strae-oqa.de/stra%C3%9Fe] PASSED [ 51%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://stra\xc3\x9fe.de/stra\xc3\x9fe-http://xn--strae-oqa.de/stra%C3%9Fe] PASSED [ 51%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://K\xf6nigsg\xe4\xdfchen.de/stra\xdfe-http://xn--knigsgchen-b4a3dun.de/stra%C3%9Fe] PASSED [ 51%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://K\xc3\xb6nigsg\xc3\xa4\xc3\x9fchen.de/stra\xc3\x9fe-http://xn--knigsgchen-b4a3dun.de/stra%C3%9Fe] PASSED [ 52%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://xn--n3h.net/-http://xn--n3h.net/1] PASSED [ 52%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://[1200:0000:ab00:1234:0000:2552:7777:1313]:12345/-http://[1200:0000:ab00:1234:0000:2552:7777:1313]:12345/0] PASSED [ 52%] >tests/test_requests.py::TestPreparingURLs::test_preparing_url[http://[1200:0000:ab00:1234:0000:2552:7777:1313]:12345/-http://[1200:0000:ab00:1234:0000:2552:7777:1313]:12345/1] PASSED [ 52%] >tests/test_requests.py::TestPreparingURLs::test_preparing_bad_url[http://*.google.com0] PASSED [ 52%] >tests/test_requests.py::TestPreparingURLs::test_preparing_bad_url[http://*0] PASSED [ 53%] >tests/test_requests.py::TestPreparingURLs::test_preparing_bad_url[http://*.google.com1] PASSED [ 53%] >tests/test_requests.py::TestPreparingURLs::test_preparing_bad_url[http://*1] PASSED [ 53%] >tests/test_requests.py::TestPreparingURLs::test_preparing_bad_url[http://\u2603.net/] PASSED [ 53%] >tests/test_requests.py::TestPreparingURLs::test_redirecting_to_bad_url[http://localhost:-1-InvalidURL] PASSED [ 53%] >tests/test_requests.py::TestPreparingURLs::test_url_mutation[http+unix://%2Fvar%2Frun%2Fsocket/path%7E-http+unix://%2Fvar%2Frun%2Fsocket/path~0] PASSED [ 53%] >tests/test_requests.py::TestPreparingURLs::test_url_mutation[http+unix://%2Fvar%2Frun%2Fsocket/path%7E-http+unix://%2Fvar%2Frun%2Fsocket/path~1] PASSED [ 54%] >tests/test_requests.py::TestPreparingURLs::test_url_mutation[mailto:user@example.org-mailto:user@example.org0] PASSED [ 54%] >tests/test_requests.py::TestPreparingURLs::test_url_mutation[mailto:user@example.org-mailto:user@example.org1] PASSED [ 54%] >tests/test_requests.py::TestPreparingURLs::test_url_mutation[data:SSDimaUgUHl0aG9uIQ==-data:SSDimaUgUHl0aG9uIQ==] PASSED [ 54%] >tests/test_requests.py::TestPreparingURLs::test_parameters_for_nonstandard_schemes[http+unix://%2Fvar%2Frun%2Fsocket/path-params0-http+unix://%2Fvar%2Frun%2Fsocket/path?key=value] PASSED [ 54%] >tests/test_requests.py::TestPreparingURLs::test_parameters_for_nonstandard_schemes[http+unix://%2Fvar%2Frun%2Fsocket/path-params1-http+unix://%2Fvar%2Frun%2Fsocket/path?key=value] PASSED [ 55%] >tests/test_requests.py::TestPreparingURLs::test_parameters_for_nonstandard_schemes[mailto:user@example.org-params2-mailto:user@example.org] PASSED [ 55%] >tests/test_requests.py::TestPreparingURLs::test_parameters_for_nonstandard_schemes[mailto:user@example.org-params3-mailto:user@example.org] PASSED [ 55%] >tests/test_structures.py::TestCaseInsensitiveDict::test_list PASSED [ 55%] >tests/test_structures.py::TestCaseInsensitiveDict::test_getitem[accept] PASSED [ 55%] >tests/test_structures.py::TestCaseInsensitiveDict::test_getitem[ACCEPT] PASSED [ 56%] >tests/test_structures.py::TestCaseInsensitiveDict::test_getitem[aCcEpT] PASSED [ 56%] >tests/test_structures.py::TestCaseInsensitiveDict::test_getitem[Accept] PASSED [ 56%] >tests/test_structures.py::TestCaseInsensitiveDict::test_delitem[accept] PASSED [ 56%] >tests/test_structures.py::TestCaseInsensitiveDict::test_delitem[ACCEPT] PASSED [ 56%] >tests/test_structures.py::TestCaseInsensitiveDict::test_delitem[aCcEpT] PASSED [ 56%] >tests/test_structures.py::TestCaseInsensitiveDict::test_delitem[Accept] PASSED [ 57%] >tests/test_structures.py::TestCaseInsensitiveDict::test_lower_items PASSED [ 57%] >tests/test_structures.py::TestCaseInsensitiveDict::test_repr PASSED [ 57%] >tests/test_structures.py::TestCaseInsensitiveDict::test_copy PASSED [ 57%] >tests/test_structures.py::TestCaseInsensitiveDict::test_instance_equality[other0-True] PASSED [ 57%] >tests/test_structures.py::TestCaseInsensitiveDict::test_instance_equality[other1-False] PASSED [ 58%] >tests/test_structures.py::TestCaseInsensitiveDict::test_instance_equality[None-False] PASSED [ 58%] >tests/test_structures.py::TestLookupDict::test_repr PASSED [ 58%] >tests/test_structures.py::TestLookupDict::test_getitem[bad_gateway-502] PASSED [ 58%] >tests/test_structures.py::TestLookupDict::test_getitem[not_a_key-None] PASSED [ 58%] >tests/test_structures.py::TestLookupDict::test_get[bad_gateway-502] PASSED [ 58%] >tests/test_structures.py::TestLookupDict::test_get[not_a_key-None] PASSED [ 59%] >tests/test_testserver.py::TestTestServer::test_basic FAILED [ 59%] >tests/test_testserver.py::TestTestServer::test_server_closes FAILED [ 59%] >tests/test_testserver.py::TestTestServer::test_text_response FAILED [ 59%] >tests/test_testserver.py::TestTestServer::test_basic_response FAILED [ 59%] >tests/test_testserver.py::TestTestServer::test_basic_waiting_server FAILED [ 60%] >tests/test_testserver.py::TestTestServer::test_multiple_requests FAILED [ 60%] >tests/test_testserver.py::TestTestServer::test_request_recovery SKIPPED [ 60%] >tests/test_testserver.py::TestTestServer::test_requests_after_timeout_are_not_received FAILED [ 60%] >tests/test_testserver.py::TestTestServer::test_request_recovery_with_bigger_timeout FAILED [ 60%] >tests/test_testserver.py::TestTestServer::test_server_finishes_on_error PASSED [ 61%] >tests/test_testserver.py::TestTestServer::test_server_finishes_when_no_connections PASSED [ 61%] >tests/test_utils.py::TestSuperLen::test_io_streams[StringIO-Test] PASSED [ 61%] >tests/test_utils.py::TestSuperLen::test_io_streams[BytesIO-Test] PASSED [ 61%] >tests/test_utils.py::TestSuperLen::test_io_streams[stream2-Test] PASSED [ 61%] >tests/test_utils.py::TestSuperLen::test_super_len_correctly_calculates_len_of_partially_read_file PASSED [ 61%] >tests/test_utils.py::TestSuperLen::test_super_len_handles_files_raising_weird_errors_in_tell[IOError] PASSED [ 62%] >tests/test_utils.py::TestSuperLen::test_super_len_handles_files_raising_weird_errors_in_tell[OSError] PASSED [ 62%] >tests/test_utils.py::TestSuperLen::test_super_len_tell_ioerror[IOError] PASSED [ 62%] >tests/test_utils.py::TestSuperLen::test_super_len_tell_ioerror[OSError] PASSED [ 62%] >tests/test_utils.py::TestSuperLen::test_string PASSED [ 62%] >tests/test_utils.py::TestSuperLen::test_file[r-1] PASSED [ 63%] >tests/test_utils.py::TestSuperLen::test_file[rb-0] PASSED [ 63%] >tests/test_utils.py::TestSuperLen::test_super_len_with__len__ PASSED [ 63%] >tests/test_utils.py::TestSuperLen::test_super_len_with_no__len__ PASSED [ 63%] >tests/test_utils.py::TestSuperLen::test_super_len_with_tell PASSED [ 63%] >tests/test_utils.py::TestSuperLen::test_super_len_with_fileno PASSED [ 64%] >tests/test_utils.py::TestSuperLen::test_super_len_with_no_matches PASSED [ 64%] >tests/test_utils.py::TestToKeyValList::test_valid[value0-expected0] PASSED [ 64%] >tests/test_utils.py::TestToKeyValList::test_valid[value1-expected1] PASSED [ 64%] >tests/test_utils.py::TestToKeyValList::test_valid[value2-expected2] PASSED [ 64%] >tests/test_utils.py::TestToKeyValList::test_valid[None-None] PASSED [ 64%] >tests/test_utils.py::TestToKeyValList::test_invalid PASSED [ 65%] >tests/test_utils.py::TestUnquoteHeaderValue::test_valid[None-None] PASSED [ 65%] >tests/test_utils.py::TestUnquoteHeaderValue::test_valid[Test-Test] PASSED [ 65%] >tests/test_utils.py::TestUnquoteHeaderValue::test_valid["Test"-Test] PASSED [ 65%] >tests/test_utils.py::TestUnquoteHeaderValue::test_valid["Test\\"-Test\] PASSED [ 65%] >tests/test_utils.py::TestUnquoteHeaderValue::test_valid["\\Comp\Res"-\Comp\Res] PASSED [ 66%] >tests/test_utils.py::TestUnquoteHeaderValue::test_is_filename PASSED [ 66%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass[no_proxy-http://192.168.0.1:5000/] PASSED [ 66%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass[no_proxy-http://192.168.0.1/] PASSED [ 66%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass[no_proxy-http://172.16.1.1/] PASSED [ 66%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass[no_proxy-http://172.16.1.1:5000/] PASSED [ 66%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass[no_proxy-http://localhost.localdomain:5000/v1.0/] PASSED [ 67%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass[NO_PROXY-http://192.168.0.1:5000/] PASSED [ 67%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass[NO_PROXY-http://192.168.0.1/] PASSED [ 67%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass[NO_PROXY-http://172.16.1.1/] PASSED [ 67%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass[NO_PROXY-http://172.16.1.1:5000/] PASSED [ 67%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass[NO_PROXY-http://localhost.localdomain:5000/v1.0/] PASSED [ 68%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass[no_proxy-http://192.168.1.1:5000/] PASSED [ 68%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass[no_proxy-http://192.168.1.1/] PASSED [ 68%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass[no_proxy-http://www.requests.com/] PASSED [ 68%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass[NO_PROXY-http://192.168.1.1:5000/] PASSED [ 68%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass[NO_PROXY-http://192.168.1.1/] PASSED [ 69%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass[NO_PROXY-http://www.requests.com/] PASSED [ 69%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass_no_proxy_keyword[no_proxy-http://192.168.1.1:5000/] PASSED [ 69%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass_no_proxy_keyword[no_proxy-http://192.168.1.1/] PASSED [ 69%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass_no_proxy_keyword[no_proxy-http://www.requests.com/] PASSED [ 69%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass_no_proxy_keyword[NO_PROXY-http://192.168.1.1:5000/] PASSED [ 69%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass_no_proxy_keyword[NO_PROXY-http://192.168.1.1/] PASSED [ 70%] >tests/test_utils.py::TestGetEnvironProxies::test_bypass_no_proxy_keyword[NO_PROXY-http://www.requests.com/] PASSED [ 70%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass_no_proxy_keyword[no_proxy-http://192.168.0.1:5000/] PASSED [ 70%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass_no_proxy_keyword[no_proxy-http://192.168.0.1/] PASSED [ 70%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass_no_proxy_keyword[no_proxy-http://172.16.1.1/] PASSED [ 70%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass_no_proxy_keyword[no_proxy-http://172.16.1.1:5000/] PASSED [ 71%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass_no_proxy_keyword[no_proxy-http://localhost.localdomain:5000/v1.0/] PASSED [ 71%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass_no_proxy_keyword[NO_PROXY-http://192.168.0.1:5000/] PASSED [ 71%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass_no_proxy_keyword[NO_PROXY-http://192.168.0.1/] PASSED [ 71%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass_no_proxy_keyword[NO_PROXY-http://172.16.1.1/] PASSED [ 71%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass_no_proxy_keyword[NO_PROXY-http://172.16.1.1:5000/] PASSED [ 71%] >tests/test_utils.py::TestGetEnvironProxies::test_not_bypass_no_proxy_keyword[NO_PROXY-http://localhost.localdomain:5000/v1.0/] PASSED [ 72%] >tests/test_utils.py::TestIsIPv4Address::test_valid PASSED [ 72%] >tests/test_utils.py::TestIsIPv4Address::test_invalid[8.8.8.8.8] PASSED [ 72%] >tests/test_utils.py::TestIsIPv4Address::test_invalid[localhost.localdomain] PASSED [ 72%] >tests/test_utils.py::TestIsValidCIDR::test_valid PASSED [ 72%] >tests/test_utils.py::TestIsValidCIDR::test_invalid[8.8.8.8] PASSED [ 73%] >tests/test_utils.py::TestIsValidCIDR::test_invalid[192.168.1.0/a] PASSED [ 73%] >tests/test_utils.py::TestIsValidCIDR::test_invalid[192.168.1.0/128] PASSED [ 73%] >tests/test_utils.py::TestIsValidCIDR::test_invalid[192.168.1.0/-1] PASSED [ 73%] >tests/test_utils.py::TestIsValidCIDR::test_invalid[192.168.1.999/24] PASSED [ 73%] >tests/test_utils.py::TestAddressInNetwork::test_valid PASSED [ 74%] >tests/test_utils.py::TestAddressInNetwork::test_invalid PASSED [ 74%] >tests/test_utils.py::TestGuessFilename::test_guess_filename_invalid[1] PASSED [ 74%] >tests/test_utils.py::TestGuessFilename::test_guess_filename_invalid[value1] PASSED [ 74%] >tests/test_utils.py::TestGuessFilename::test_guess_filename_valid[value-str] PASSED [ 74%] >tests/test_utils.py::TestGuessFilename::test_guess_filename_valid[value-unicode] PASSED [ 74%] >tests/test_utils.py::TestExtractZippedPaths::test_unzipped_paths_unchanged[/] PASSED [ 75%] >tests/test_utils.py::TestExtractZippedPaths::test_unzipped_paths_unchanged[/var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0/tests/test_utils.py] PASSED [ 75%] >tests/test_utils.py::TestExtractZippedPaths::test_unzipped_paths_unchanged[/usr/lib64/python2.7/site-packages/pytest.pyc] PASSED [ 75%] >tests/test_utils.py::TestExtractZippedPaths::test_unzipped_paths_unchanged[/etc/invalid/location] PASSED [ 75%] >tests/test_utils.py::TestExtractZippedPaths::test_zipped_paths_extracted PASSED [ 75%] >tests/test_utils.py::TestContentEncodingDetection::test_none PASSED [ 76%] >tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta charset="UTF-8">] PASSED [ 76%] >tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta http-equiv="Content-type" content="text/html;charset=UTF-8">] PASSED [ 76%] >tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />] PASSED [ 76%] >tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<?xml version="1.0" encoding="UTF-8"?>] PASSED [ 76%] >tests/test_utils.py::TestContentEncodingDetection::test_precedence PASSED [ 76%] >tests/test_utils.py::TestGuessJSONUTF::test_encoded[utf-32] PASSED [ 77%] >tests/test_utils.py::TestGuessJSONUTF::test_encoded[utf-8-sig] PASSED [ 77%] >tests/test_utils.py::TestGuessJSONUTF::test_encoded[utf-16] PASSED [ 77%] >tests/test_utils.py::TestGuessJSONUTF::test_encoded[utf-8] PASSED [ 77%] >tests/test_utils.py::TestGuessJSONUTF::test_encoded[utf-16-be] PASSED [ 77%] >tests/test_utils.py::TestGuessJSONUTF::test_encoded[utf-16-le] PASSED [ 78%] >tests/test_utils.py::TestGuessJSONUTF::test_encoded[utf-32-be] PASSED [ 78%] >tests/test_utils.py::TestGuessJSONUTF::test_encoded[utf-32-le] PASSED [ 78%] >tests/test_utils.py::TestGuessJSONUTF::test_bad_utf_like_encoding PASSED [ 78%] >tests/test_utils.py::TestGuessJSONUTF::test_guess_by_bom[utf-16-be-utf-16] PASSED [ 78%] >tests/test_utils.py::TestGuessJSONUTF::test_guess_by_bom[utf-16-le-utf-16] PASSED [ 79%] >tests/test_utils.py::TestGuessJSONUTF::test_guess_by_bom[utf-32-be-utf-32] PASSED [ 79%] >tests/test_utils.py::TestGuessJSONUTF::test_guess_by_bom[utf-32-le-utf-32] PASSED [ 79%] >tests/test_utils.py::test_get_auth_from_url[http://%25%21%2A%27%28%29%3B%3A%40%26%3D%2B%24%2C%2F%3F%23%5B%5D%20:%25%21%2A%27%28%29%3B%3A%40%26%3D%2B%24%2C%2F%3F%23%5B%5D%20@request.com/url.html#test-auth0] PASSED [ 79%] >tests/test_utils.py::test_get_auth_from_url[http://user:pass@complex.url.com/path?query=yes-auth1] PASSED [ 79%] >tests/test_utils.py::test_get_auth_from_url[http://user:pass%20pass@complex.url.com/path?query=yes-auth2] PASSED [ 79%] >tests/test_utils.py::test_get_auth_from_url[http://user:pass pass@complex.url.com/path?query=yes-auth3] PASSED [ 80%] >tests/test_utils.py::test_get_auth_from_url[http://user%25user:pass@complex.url.com/path?query=yes-auth4] PASSED [ 80%] >tests/test_utils.py::test_get_auth_from_url[http://user:pass%23pass@complex.url.com/path?query=yes-auth5] PASSED [ 80%] >tests/test_utils.py::test_get_auth_from_url[http://complex.url.com/path?query=yes-auth6] PASSED [ 80%] >tests/test_utils.py::test_requote_uri_with_unquoted_percents[http://example.com/fiz?buz=%25ppicture-http://example.com/fiz?buz=%25ppicture] PASSED [ 80%] >tests/test_utils.py::test_requote_uri_with_unquoted_percents[http://example.com/fiz?buz=%ppicture-http://example.com/fiz?buz=%25ppicture] PASSED [ 81%] >tests/test_utils.py::test_unquote_unreserved[http://example.com/?a=%---http://example.com/?a=%--] PASSED [ 81%] >tests/test_utils.py::test_unquote_unreserved[http://example.com/?a=%300-http://example.com/?a=00] PASSED [ 81%] >tests/test_utils.py::test_dotted_netmask[8-255.0.0.0] PASSED [ 81%] >tests/test_utils.py::test_dotted_netmask[24-255.255.255.0] PASSED [ 81%] >tests/test_utils.py::test_dotted_netmask[25-255.255.255.128] PASSED [ 82%] >tests/test_utils.py::test_select_proxies[hTTp://u:p@Some.Host/path-http://some.host.proxy-proxies0] PASSED [ 82%] >tests/test_utils.py::test_select_proxies[hTTp://u:p@Other.Host/path-http://http.proxy-proxies1] PASSED [ 82%] >tests/test_utils.py::test_select_proxies[hTTp:///path-http://http.proxy-proxies2] PASSED [ 82%] >tests/test_utils.py::test_select_proxies[hTTps://Other.Host-None-proxies3] PASSED [ 82%] >tests/test_utils.py::test_select_proxies[file:///etc/motd-None-proxies4] PASSED [ 82%] >tests/test_utils.py::test_select_proxies[hTTp://u:p@Some.Host/path-socks5://some.host.proxy-proxies5] PASSED [ 83%] >tests/test_utils.py::test_select_proxies[hTTp://u:p@Other.Host/path-socks5://http.proxy-proxies6] PASSED [ 83%] >tests/test_utils.py::test_select_proxies[hTTp:///path-socks5://http.proxy-proxies7] PASSED [ 83%] >tests/test_utils.py::test_select_proxies[hTTps://Other.Host-socks5://http.proxy-proxies8] PASSED [ 83%] >tests/test_utils.py::test_select_proxies[http://u:p@other.host/path-http://http.proxy-proxies9] PASSED [ 83%] >tests/test_utils.py::test_select_proxies[http://u:p@some.host/path-http://some.host.proxy-proxies10] PASSED [ 84%] >tests/test_utils.py::test_select_proxies[https://u:p@other.host/path-socks5://http.proxy-proxies11] PASSED [ 84%] >tests/test_utils.py::test_select_proxies[https://u:p@some.host/path-socks5://http.proxy-proxies12] PASSED [ 84%] >tests/test_utils.py::test_select_proxies[https://-socks5://http.proxy-proxies13] PASSED [ 84%] >tests/test_utils.py::test_select_proxies[file:///etc/motd-socks5://http.proxy-proxies14] PASSED [ 84%] >tests/test_utils.py::test_parse_dict_header[foo="is a fish", bar="as well"-expected0] PASSED [ 84%] >tests/test_utils.py::test_parse_dict_header[key_without_value-expected1] PASSED [ 85%] >tests/test_utils.py::test__parse_content_type_header[application/xml-expected0] PASSED [ 85%] >tests/test_utils.py::test__parse_content_type_header[application/json ; charset=utf-8-expected1] PASSED [ 85%] >tests/test_utils.py::test__parse_content_type_header[application/json ; Charset=utf-8-expected2] PASSED [ 85%] >tests/test_utils.py::test__parse_content_type_header[text/plain-expected3] PASSED [ 85%] >tests/test_utils.py::test__parse_content_type_header[multipart/form-data; boundary = something ; boundary2='something_else' ; no_equals -expected4] PASSED [ 86%] >tests/test_utils.py::test__parse_content_type_header[multipart/form-data; boundary = something ; boundary2="something_else" ; no_equals -expected5] PASSED [ 86%] >tests/test_utils.py::test__parse_content_type_header[multipart/form-data; boundary = something ; 'boundary2=something_else' ; no_equals -expected6] PASSED [ 86%] >tests/test_utils.py::test__parse_content_type_header[multipart/form-data; boundary = something ; "boundary2=something_else" ; no_equals -expected7] PASSED [ 86%] >tests/test_utils.py::test__parse_content_type_header[application/json ; ; -expected8] PASSED [ 86%] >tests/test_utils.py::test_get_encoding_from_headers[value0-None] PASSED [ 87%] >tests/test_utils.py::test_get_encoding_from_headers[value1-utf-8] PASSED [ 87%] >tests/test_utils.py::test_get_encoding_from_headers[value2-ISO-8859-1] PASSED [ 87%] >tests/test_utils.py::test_iter_slices[-0] PASSED [ 87%] >tests/test_utils.py::test_iter_slices[T-1] PASSED [ 87%] >tests/test_utils.py::test_iter_slices[Test-4] PASSED [ 87%] >tests/test_utils.py::test_iter_slices[Cont-0] PASSED [ 88%] >tests/test_utils.py::test_iter_slices[Other--5] PASSED [ 88%] >tests/test_utils.py::test_iter_slices[Content-None] PASSED [ 88%] >tests/test_utils.py::test_parse_header_links[<http:/.../front.jpeg>; rel=front; type="image/jpeg"-expected0] PASSED [ 88%] >tests/test_utils.py::test_parse_header_links[<http:/.../front.jpeg>-expected1] PASSED [ 88%] >tests/test_utils.py::test_parse_header_links[<http:/.../front.jpeg>;-expected2] PASSED [ 89%] >tests/test_utils.py::test_parse_header_links[<http:/.../front.jpeg>; type="image/jpeg",<http://.../back.jpeg>;-expected3] PASSED [ 89%] >tests/test_utils.py::test_parse_header_links[-expected4] PASSED [ 89%] >tests/test_utils.py::test_prepend_scheme_if_needed[example.com/path-http://example.com/path] PASSED [ 89%] >tests/test_utils.py::test_prepend_scheme_if_needed[//example.com/path-http://example.com/path] PASSED [ 89%] >tests/test_utils.py::test_to_native_string[T-T0] PASSED [ 89%] >tests/test_utils.py::test_to_native_string[T-T1] PASSED [ 90%] >tests/test_utils.py::test_to_native_string[T-T2] PASSED [ 90%] >tests/test_utils.py::test_urldefragauth[http://u:p@example.com/path?a=1#test-http://example.com/path?a=1] PASSED [ 90%] >tests/test_utils.py::test_urldefragauth[http://example.com/path-http://example.com/path] PASSED [ 90%] >tests/test_utils.py::test_urldefragauth[//u:p@example.com/path-//example.com/path] PASSED [ 90%] >tests/test_utils.py::test_urldefragauth[//example.com/path-//example.com/path] PASSED [ 91%] >tests/test_utils.py::test_urldefragauth[example.com/path-//example.com/path] PASSED [ 91%] >tests/test_utils.py::test_urldefragauth[scheme:u:p@example.com/path-scheme://example.com/path] PASSED [ 91%] >tests/test_utils.py::test_should_bypass_proxies[http://192.168.0.1:5000/-True] PASSED [ 91%] >tests/test_utils.py::test_should_bypass_proxies[http://192.168.0.1/-True] PASSED [ 91%] >tests/test_utils.py::test_should_bypass_proxies[http://172.16.1.1/-True] PASSED [ 92%] >tests/test_utils.py::test_should_bypass_proxies[http://172.16.1.1:5000/-True] PASSED [ 92%] >tests/test_utils.py::test_should_bypass_proxies[http://localhost.localdomain:5000/v1.0/-True] PASSED [ 92%] >tests/test_utils.py::test_should_bypass_proxies[http://google.com:6000/-True] PASSED [ 92%] >tests/test_utils.py::test_should_bypass_proxies[http://172.16.1.12/-False] PASSED [ 92%] >tests/test_utils.py::test_should_bypass_proxies[http://172.16.1.12:5000/-False] PASSED [ 92%] >tests/test_utils.py::test_should_bypass_proxies[http://google.com:5000/v1.0/-False] PASSED [ 93%] >tests/test_utils.py::test_should_bypass_proxies[file:///some/path/on/disk-True] PASSED [ 93%] >tests/test_utils.py::test_should_bypass_proxies_pass_only_hostname[http://172.16.1.1/-172.16.1.1] PASSED [ 93%] >tests/test_utils.py::test_should_bypass_proxies_pass_only_hostname[http://172.16.1.1:5000/-172.16.1.1] PASSED [ 93%] >tests/test_utils.py::test_should_bypass_proxies_pass_only_hostname[http://user:pass@172.16.1.1-172.16.1.1] PASSED [ 93%] >tests/test_utils.py::test_should_bypass_proxies_pass_only_hostname[http://user:pass@172.16.1.1:5000-172.16.1.1] PASSED [ 94%] >tests/test_utils.py::test_should_bypass_proxies_pass_only_hostname[http://hostname/-hostname] PASSED [ 94%] >tests/test_utils.py::test_should_bypass_proxies_pass_only_hostname[http://hostname:5000/-hostname] PASSED [ 94%] >tests/test_utils.py::test_should_bypass_proxies_pass_only_hostname[http://user:pass@hostname-hostname] PASSED [ 94%] >tests/test_utils.py::test_should_bypass_proxies_pass_only_hostname[http://user:pass@hostname:5000-hostname] PASSED [ 94%] >tests/test_utils.py::test_add_dict_to_cookiejar[cookiejar0] PASSED [ 94%] >tests/test_utils.py::test_add_dict_to_cookiejar[cookiejar1] PASSED [ 95%] >tests/test_utils.py::test_unicode_is_ascii[test-True] PASSED [ 95%] >tests/test_utils.py::test_unicode_is_ascii[\xe6\xed\xf6\xfb-False] PASSED [ 95%] >tests/test_utils.py::test_unicode_is_ascii[\u30b8\u30a7\u30fc\u30d4\u30fc\u30cb\u30c3\u30af-False] PASSED [ 95%] >tests/test_utils.py::test_should_bypass_proxies_no_proxy[http://192.168.0.1:5000/-True] PASSED [ 95%] >tests/test_utils.py::test_should_bypass_proxies_no_proxy[http://192.168.0.1/-True] PASSED [ 96%] >tests/test_utils.py::test_should_bypass_proxies_no_proxy[http://172.16.1.1/-True] PASSED [ 96%] >tests/test_utils.py::test_should_bypass_proxies_no_proxy[http://172.16.1.1:5000/-True] PASSED [ 96%] >tests/test_utils.py::test_should_bypass_proxies_no_proxy[http://localhost.localdomain:5000/v1.0/-True] PASSED [ 96%] >tests/test_utils.py::test_should_bypass_proxies_no_proxy[http://172.16.1.12/-False] PASSED [ 96%] >tests/test_utils.py::test_should_bypass_proxies_no_proxy[http://172.16.1.12:5000/-False] PASSED [ 97%] >tests/test_utils.py::test_should_bypass_proxies_no_proxy[http://google.com:5000/v1.0/-False] PASSED [ 97%] >tests/test_utils.py::test_should_bypass_proxies_win_registry[http://192.168.0.1:5000/-True-None] SKIPPED [ 97%] >tests/test_utils.py::test_should_bypass_proxies_win_registry[http://192.168.0.1/-True-None] SKIPPED [ 97%] >tests/test_utils.py::test_should_bypass_proxies_win_registry[http://172.16.1.1/-True-None] SKIPPED [ 97%] >tests/test_utils.py::test_should_bypass_proxies_win_registry[http://172.16.1.1:5000/-True-None] SKIPPED [ 97%] >tests/test_utils.py::test_should_bypass_proxies_win_registry[http://localhost.localdomain:5000/v1.0/-True-None] SKIPPED [ 98%] >tests/test_utils.py::test_should_bypass_proxies_win_registry[http://172.16.1.22/-False-None] SKIPPED [ 98%] >tests/test_utils.py::test_should_bypass_proxies_win_registry[http://172.16.1.22:5000/-False-None] SKIPPED [ 98%] >tests/test_utils.py::test_should_bypass_proxies_win_registry[http://google.com:5000/v1.0/-False-None] SKIPPED [ 98%] >tests/test_utils.py::test_should_bypass_proxies_win_registry[http://mylocalhostname:5000/v1.0/-True-<local>] SKIPPED [ 98%] >tests/test_utils.py::test_should_bypass_proxies_win_registry[http://192.168.0.1/-False-] SKIPPED [ 99%] >tests/test_utils.py::test_set_environ[no_proxy-192.168.0.0/24,127.0.0.1,localhost.localdomain] PASSED [ 99%] >tests/test_utils.py::test_set_environ[no_proxy-None] PASSED [ 99%] >tests/test_utils.py::test_set_environ[a_new_key-192.168.0.0/24,127.0.0.1,localhost.localdomain] PASSED [ 99%] >tests/test_utils.py::test_set_environ[a_new_key-None] PASSED [ 99%] >tests/test_utils.py::test_set_environ_raises_exception PASSED [100%] > >=============================================== FAILURES =============================================== >_________________________________________ test_chunked_upload __________________________________________ > > def test_chunked_upload(): > """can safely send generators""" > close_server = threading.Event() > server = Server.basic_response_server(wait_to_close_event=close_server) > data = iter([b'a', b'b', b'c']) > > with server as (host, port): > url = 'http://{}:{}/'.format(host, port) >> r = requests.post(url, data=data, stream=True) > >tests/test_lowlevel.py:20: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >requests/api.py:119: in post > return request('post', url, data=data, json=json, **kwargs) >requests/api.py:61: in request > return session.request(method=method, url=url, **kwargs) >requests/sessions.py:530: in request > resp = self.send(prep, **send_kwargs) >requests/sessions.py:643: in send > r = adapter.send(request, **kwargs) >requests/adapters.py:467: in send > low_conn.endheaders() >/usr/lib64/python2.7/httplib.py:1065: in endheaders > self._send_output(message_body) >/usr/lib64/python2.7/httplib.py:892: in _send_output > self.send(msg) >/usr/lib64/python2.7/httplib.py:854: in send > self.connect() >/usr/lib64/python2.7/site-packages/urllib3/connection.py:181: in connect > conn = self._new_conn() >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <urllib3.connection.HTTPConnection object at 0x3fffb0b37090> > > def _new_conn(self): > """ Establish a socket connection and set nodelay settings on it. > > :return: New socket connection. > """ > extra_kw = {} > if self.source_address: > extra_kw['source_address'] = self.source_address > > if self.socket_options: > extra_kw['socket_options'] = self.socket_options > > try: > conn = connection.create_connection( > (self._dns_host, self.port), self.timeout, **extra_kw) > > except SocketTimeout as e: > raise ConnectTimeoutError( > self, "Connection to %s timed out. (connect timeout=%s)" % > (self.host, self.timeout)) > > except SocketError as e: > raise NewConnectionError( >> self, "Failed to establish a new connection: %s" % e) >E NewConnectionError: <urllib3.connection.HTTPConnection object at 0x3fffb0b37090>: Failed to establish a new connection: [Errno 111] Connection refused > >/usr/lib64/python2.7/site-packages/urllib3/connection.py:168: NewConnectionError >_____________________________ test_digestauth_401_count_reset_on_redirect ______________________________ > > def test_digestauth_401_count_reset_on_redirect(): > """Ensure we correctly reset num_401_calls after a successful digest auth, > followed by a 302 redirect to another digest auth prompt. > > See https://github.com/psf/requests/issues/1979. > """ > text_401 = (b'HTTP/1.1 401 UNAUTHORIZED\r\n' > b'Content-Length: 0\r\n' > b'WWW-Authenticate: Digest nonce="6bf5d6e4da1ce66918800195d6b9130d"' > b', opaque="372825293d1c26955496c80ed6426e9e", ' > b'realm="me@kennethreitz.com", qop=auth\r\n\r\n') > > text_302 = (b'HTTP/1.1 302 FOUND\r\n' > b'Content-Length: 0\r\n' > b'Location: /\r\n\r\n') > > text_200 = (b'HTTP/1.1 200 OK\r\n' > b'Content-Length: 0\r\n\r\n') > > expected_digest = (b'Authorization: Digest username="user", ' > b'realm="me@kennethreitz.com", ' > b'nonce="6bf5d6e4da1ce66918800195d6b9130d", uri="/"') > > auth = requests.auth.HTTPDigestAuth('user', 'pass') > > def digest_response_handler(sock): > # Respond to initial GET with a challenge. > request_content = consume_socket_content(sock, timeout=0.5) > assert request_content.startswith(b"GET / HTTP/1.1") > sock.send(text_401) > > # Verify we receive an Authorization header in response, then redirect. > request_content = consume_socket_content(sock, timeout=0.5) > assert expected_digest in request_content > sock.send(text_302) > > # Verify Authorization isn't sent to the redirected host, > # then send another challenge. > request_content = consume_socket_content(sock, timeout=0.5) > assert b'Authorization:' not in request_content > sock.send(text_401) > > # Verify Authorization is sent correctly again, and return 200 OK. > request_content = consume_socket_content(sock, timeout=0.5) > assert expected_digest in request_content > sock.send(text_200) > > return request_content > > close_server = threading.Event() > server = Server(digest_response_handler, wait_to_close_event=close_server) > > with server as (host, port): > url = 'http://{}:{}/'.format(host, port) >> r = requests.get(url, auth=auth) > >tests/test_lowlevel.py:81: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >requests/api.py:76: in get > return request('get', url, params=params, **kwargs) >requests/api.py:61: in request > return session.request(method=method, url=url, **kwargs) >requests/sessions.py:530: in request > resp = self.send(prep, **send_kwargs) >requests/sessions.py:643: in send > r = adapter.send(request, **kwargs) >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <requests.adapters.HTTPAdapter object at 0x3fffb09eced0>, request = <PreparedRequest [GET]> >stream = False, timeout = <urllib3.util.timeout.Timeout object at 0x3fffb09ecc90>, verify = True >cert = None, proxies = OrderedDict() > > def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None): > """Sends PreparedRequest object. Returns Response object. > > :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. > :param stream: (optional) Whether to stream the request content. > :param timeout: (optional) How long to wait for the server to send > data before giving up, as a float, or a :ref:`(connect timeout, > read timeout) <timeouts>` tuple. > :type timeout: float or tuple or urllib3 Timeout object > :param verify: (optional) Either a boolean, in which case it controls whether > we verify the server's TLS certificate, or a string, in which case it > must be a path to a CA bundle to use > :param cert: (optional) Any user-provided SSL certificate to be trusted. > :param proxies: (optional) The proxies dictionary to apply to the request. > :rtype: requests.Response > """ > > try: > conn = self.get_connection(request.url, proxies) > except LocationValueError as e: > raise InvalidURL(e, request=request) > > self.cert_verify(conn, request.url, verify, cert) > url = self.request_url(request, proxies) > self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) > > chunked = not (request.body is None or 'Content-Length' in request.headers) > > if isinstance(timeout, tuple): > try: > connect, read = timeout > timeout = TimeoutSauce(connect=connect, read=read) > except ValueError as e: > # this may raise a string formatting error. > err = ("Invalid timeout {}. Pass a (connect, read) " > "timeout tuple, or a single float to set " > "both timeouts to the same value".format(timeout)) > raise ValueError(err) > elif isinstance(timeout, TimeoutSauce): > pass > else: > timeout = TimeoutSauce(connect=timeout, read=timeout) > > try: > if not chunked: > resp = conn.urlopen( > method=request.method, > url=url, > body=request.body, > headers=request.headers, > redirect=False, > assert_same_host=False, > preload_content=False, > decode_content=False, > retries=self.max_retries, > timeout=timeout > ) > > # Send the request. > else: > if hasattr(conn, 'proxy_pool'): > conn = conn.proxy_pool > > low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT) > > try: > low_conn.putrequest(request.method, > url, > skip_accept_encoding=True) > > for header, value in request.headers.items(): > low_conn.putheader(header, value) > > low_conn.endheaders() > > for i in request.body: > low_conn.send(hex(len(i))[2:].encode('utf-8')) > low_conn.send(b'\r\n') > low_conn.send(i) > low_conn.send(b'\r\n') > low_conn.send(b'0\r\n\r\n') > > # Receive the response from the server > try: > # For Python 2.7, use buffering of HTTP responses > r = low_conn.getresponse(buffering=True) > except TypeError: > # For compatibility with Python 3.3+ > r = low_conn.getresponse() > > resp = HTTPResponse.from_httplib( > r, > pool=conn, > connection=low_conn, > preload_content=False, > decode_content=False > ) > except: > # If we hit any problems here, clean up the connection. > # Then, reraise so that we can handle the actual exception. > low_conn.close() > raise > > except (ProtocolError, socket.error) as err: > raise ConnectionError(err, request=request) > > except MaxRetryError as e: > if isinstance(e.reason, ConnectTimeoutError): > # TODO: Remove this in 3.0.0: see #2811 > if not isinstance(e.reason, NewConnectionError): > raise ConnectTimeout(e, request=request) > > if isinstance(e.reason, ResponseError): > raise RetryError(e, request=request) > > if isinstance(e.reason, _ProxyError): > raise ProxyError(e, request=request) > > if isinstance(e.reason, _SSLError): > # This branch is for urllib3 v1.22 and later. > raise SSLError(e, request=request) > >> raise ConnectionError(e, request=request) >E ConnectionError: HTTPConnectionPool(host='localhost', port=41093): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x3fffb09fc050>: Failed to establish a new connection: [Errno 111] Connection refused',)) > >requests/adapters.py:516: ConnectionError >__________________________________ test_digestauth_401_only_sent_once __________________________________ > > def test_digestauth_401_only_sent_once(): > """Ensure we correctly respond to a 401 challenge once, and then > stop responding if challenged again. > """ > text_401 = (b'HTTP/1.1 401 UNAUTHORIZED\r\n' > b'Content-Length: 0\r\n' > b'WWW-Authenticate: Digest nonce="6bf5d6e4da1ce66918800195d6b9130d"' > b', opaque="372825293d1c26955496c80ed6426e9e", ' > b'realm="me@kennethreitz.com", qop=auth\r\n\r\n') > > expected_digest = (b'Authorization: Digest username="user", ' > b'realm="me@kennethreitz.com", ' > b'nonce="6bf5d6e4da1ce66918800195d6b9130d", uri="/"') > > auth = requests.auth.HTTPDigestAuth('user', 'pass') > > def digest_failed_response_handler(sock): > # Respond to initial GET with a challenge. > request_content = consume_socket_content(sock, timeout=0.5) > assert request_content.startswith(b"GET / HTTP/1.1") > sock.send(text_401) > > # Verify we receive an Authorization header in response, then > # challenge again. > request_content = consume_socket_content(sock, timeout=0.5) > assert expected_digest in request_content > sock.send(text_401) > > # Verify the client didn't respond to second challenge. > request_content = consume_socket_content(sock, timeout=0.5) > assert request_content == b'' > > return request_content > > close_server = threading.Event() > server = Server(digest_failed_response_handler, wait_to_close_event=close_server) > > with server as (host, port): > url = 'http://{}:{}/'.format(host, port) >> r = requests.get(url, auth=auth) > >tests/test_lowlevel.py:131: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >requests/api.py:76: in get > return request('get', url, params=params, **kwargs) >requests/api.py:61: in request > return session.request(method=method, url=url, **kwargs) >requests/sessions.py:530: in request > resp = self.send(prep, **send_kwargs) >requests/sessions.py:643: in send > r = adapter.send(request, **kwargs) >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <requests.adapters.HTTPAdapter object at 0x3fffb081abd0>, request = <PreparedRequest [GET]> >stream = False, timeout = <urllib3.util.timeout.Timeout object at 0x3fffb081a310>, verify = True >cert = None, proxies = OrderedDict() > > def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None): > """Sends PreparedRequest object. Returns Response object. > > :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. > :param stream: (optional) Whether to stream the request content. > :param timeout: (optional) How long to wait for the server to send > data before giving up, as a float, or a :ref:`(connect timeout, > read timeout) <timeouts>` tuple. > :type timeout: float or tuple or urllib3 Timeout object > :param verify: (optional) Either a boolean, in which case it controls whether > we verify the server's TLS certificate, or a string, in which case it > must be a path to a CA bundle to use > :param cert: (optional) Any user-provided SSL certificate to be trusted. > :param proxies: (optional) The proxies dictionary to apply to the request. > :rtype: requests.Response > """ > > try: > conn = self.get_connection(request.url, proxies) > except LocationValueError as e: > raise InvalidURL(e, request=request) > > self.cert_verify(conn, request.url, verify, cert) > url = self.request_url(request, proxies) > self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) > > chunked = not (request.body is None or 'Content-Length' in request.headers) > > if isinstance(timeout, tuple): > try: > connect, read = timeout > timeout = TimeoutSauce(connect=connect, read=read) > except ValueError as e: > # this may raise a string formatting error. > err = ("Invalid timeout {}. Pass a (connect, read) " > "timeout tuple, or a single float to set " > "both timeouts to the same value".format(timeout)) > raise ValueError(err) > elif isinstance(timeout, TimeoutSauce): > pass > else: > timeout = TimeoutSauce(connect=timeout, read=timeout) > > try: > if not chunked: > resp = conn.urlopen( > method=request.method, > url=url, > body=request.body, > headers=request.headers, > redirect=False, > assert_same_host=False, > preload_content=False, > decode_content=False, > retries=self.max_retries, > timeout=timeout > ) > > # Send the request. > else: > if hasattr(conn, 'proxy_pool'): > conn = conn.proxy_pool > > low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT) > > try: > low_conn.putrequest(request.method, > url, > skip_accept_encoding=True) > > for header, value in request.headers.items(): > low_conn.putheader(header, value) > > low_conn.endheaders() > > for i in request.body: > low_conn.send(hex(len(i))[2:].encode('utf-8')) > low_conn.send(b'\r\n') > low_conn.send(i) > low_conn.send(b'\r\n') > low_conn.send(b'0\r\n\r\n') > > # Receive the response from the server > try: > # For Python 2.7, use buffering of HTTP responses > r = low_conn.getresponse(buffering=True) > except TypeError: > # For compatibility with Python 3.3+ > r = low_conn.getresponse() > > resp = HTTPResponse.from_httplib( > r, > pool=conn, > connection=low_conn, > preload_content=False, > decode_content=False > ) > except: > # If we hit any problems here, clean up the connection. > # Then, reraise so that we can handle the actual exception. > low_conn.close() > raise > > except (ProtocolError, socket.error) as err: > raise ConnectionError(err, request=request) > > except MaxRetryError as e: > if isinstance(e.reason, ConnectTimeoutError): > # TODO: Remove this in 3.0.0: see #2811 > if not isinstance(e.reason, NewConnectionError): > raise ConnectTimeout(e, request=request) > > if isinstance(e.reason, ResponseError): > raise RetryError(e, request=request) > > if isinstance(e.reason, _ProxyError): > raise ProxyError(e, request=request) > > if isinstance(e.reason, _SSLError): > # This branch is for urllib3 v1.22 and later. > raise SSLError(e, request=request) > >> raise ConnectionError(e, request=request) >E ConnectionError: HTTPConnectionPool(host='localhost', port=43567): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x3fffb089ba10>: Failed to establish a new connection: [Errno 111] Connection refused',)) > >requests/adapters.py:516: ConnectionError >_____________________________________ test_digestauth_only_on_4xx ______________________________________ > > def test_digestauth_only_on_4xx(): > """Ensure we only send digestauth on 4xx challenges. > > See https://github.com/psf/requests/issues/3772. > """ > text_200_chal = (b'HTTP/1.1 200 OK\r\n' > b'Content-Length: 0\r\n' > b'WWW-Authenticate: Digest nonce="6bf5d6e4da1ce66918800195d6b9130d"' > b', opaque="372825293d1c26955496c80ed6426e9e", ' > b'realm="me@kennethreitz.com", qop=auth\r\n\r\n') > > auth = requests.auth.HTTPDigestAuth('user', 'pass') > > def digest_response_handler(sock): > # Respond to GET with a 200 containing www-authenticate header. > request_content = consume_socket_content(sock, timeout=0.5) > assert request_content.startswith(b"GET / HTTP/1.1") > sock.send(text_200_chal) > > # Verify the client didn't respond with auth. > request_content = consume_socket_content(sock, timeout=0.5) > assert request_content == b'' > > return request_content > > close_server = threading.Event() > server = Server(digest_response_handler, wait_to_close_event=close_server) > > with server as (host, port): > url = 'http://{}:{}/'.format(host, port) >> r = requests.get(url, auth=auth) > >tests/test_lowlevel.py:168: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >requests/api.py:76: in get > return request('get', url, params=params, **kwargs) >requests/api.py:61: in request > return session.request(method=method, url=url, **kwargs) >requests/sessions.py:530: in request > resp = self.send(prep, **send_kwargs) >requests/sessions.py:643: in send > r = adapter.send(request, **kwargs) >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <requests.adapters.HTTPAdapter object at 0x3fffb0aed790>, request = <PreparedRequest [GET]> >stream = False, timeout = <urllib3.util.timeout.Timeout object at 0x3fffb0aed190>, verify = True >cert = None, proxies = OrderedDict() > > def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None): > """Sends PreparedRequest object. Returns Response object. > > :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. > :param stream: (optional) Whether to stream the request content. > :param timeout: (optional) How long to wait for the server to send > data before giving up, as a float, or a :ref:`(connect timeout, > read timeout) <timeouts>` tuple. > :type timeout: float or tuple or urllib3 Timeout object > :param verify: (optional) Either a boolean, in which case it controls whether > we verify the server's TLS certificate, or a string, in which case it > must be a path to a CA bundle to use > :param cert: (optional) Any user-provided SSL certificate to be trusted. > :param proxies: (optional) The proxies dictionary to apply to the request. > :rtype: requests.Response > """ > > try: > conn = self.get_connection(request.url, proxies) > except LocationValueError as e: > raise InvalidURL(e, request=request) > > self.cert_verify(conn, request.url, verify, cert) > url = self.request_url(request, proxies) > self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) > > chunked = not (request.body is None or 'Content-Length' in request.headers) > > if isinstance(timeout, tuple): > try: > connect, read = timeout > timeout = TimeoutSauce(connect=connect, read=read) > except ValueError as e: > # this may raise a string formatting error. > err = ("Invalid timeout {}. Pass a (connect, read) " > "timeout tuple, or a single float to set " > "both timeouts to the same value".format(timeout)) > raise ValueError(err) > elif isinstance(timeout, TimeoutSauce): > pass > else: > timeout = TimeoutSauce(connect=timeout, read=timeout) > > try: > if not chunked: > resp = conn.urlopen( > method=request.method, > url=url, > body=request.body, > headers=request.headers, > redirect=False, > assert_same_host=False, > preload_content=False, > decode_content=False, > retries=self.max_retries, > timeout=timeout > ) > > # Send the request. > else: > if hasattr(conn, 'proxy_pool'): > conn = conn.proxy_pool > > low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT) > > try: > low_conn.putrequest(request.method, > url, > skip_accept_encoding=True) > > for header, value in request.headers.items(): > low_conn.putheader(header, value) > > low_conn.endheaders() > > for i in request.body: > low_conn.send(hex(len(i))[2:].encode('utf-8')) > low_conn.send(b'\r\n') > low_conn.send(i) > low_conn.send(b'\r\n') > low_conn.send(b'0\r\n\r\n') > > # Receive the response from the server > try: > # For Python 2.7, use buffering of HTTP responses > r = low_conn.getresponse(buffering=True) > except TypeError: > # For compatibility with Python 3.3+ > r = low_conn.getresponse() > > resp = HTTPResponse.from_httplib( > r, > pool=conn, > connection=low_conn, > preload_content=False, > decode_content=False > ) > except: > # If we hit any problems here, clean up the connection. > # Then, reraise so that we can handle the actual exception. > low_conn.close() > raise > > except (ProtocolError, socket.error) as err: > raise ConnectionError(err, request=request) > > except MaxRetryError as e: > if isinstance(e.reason, ConnectTimeoutError): > # TODO: Remove this in 3.0.0: see #2811 > if not isinstance(e.reason, NewConnectionError): > raise ConnectTimeout(e, request=request) > > if isinstance(e.reason, ResponseError): > raise RetryError(e, request=request) > > if isinstance(e.reason, _ProxyError): > raise ProxyError(e, request=request) > > if isinstance(e.reason, _SSLError): > # This branch is for urllib3 v1.22 and later. > raise SSLError(e, request=request) > >> raise ConnectionError(e, request=request) >E ConnectionError: HTTPConnectionPool(host='localhost', port=48501): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x3fffb09fc610>: Failed to establish a new connection: [Errno 111] Connection refused',)) > >requests/adapters.py:516: ConnectionError >___________________________ test_use_proxy_from_environment[http_proxy-http] ___________________________ > >httpbin = <function inner at 0x3fffb0f0bad0>, var = 'http_proxy', scheme = 'http' > > @pytest.mark.parametrize("var,scheme", _proxy_combos) > def test_use_proxy_from_environment(httpbin, var, scheme): > url = "{}://httpbin.org".format(scheme) > fake_proxy = Server() # do nothing with the requests; just close the socket > with fake_proxy as (host, port): > proxy_url = "socks5://{}:{}".format(host, port) > kwargs = {var: proxy_url} > with override_environ(**kwargs): > # fake proxy's lack of response will cause a ConnectionError > with pytest.raises(requests.exceptions.ConnectionError): > requests.get(url) > > # the fake proxy received a request >> assert len(fake_proxy.handler_results) == 1 >E assert 0 == 1 >E -0 >E +1 > >tests/test_lowlevel.py:202: AssertionError >__________________________ test_use_proxy_from_environment[https_proxy-https] __________________________ > >httpbin = <function inner at 0x3fffb0f0bdd0>, var = 'https_proxy', scheme = 'https' > > @pytest.mark.parametrize("var,scheme", _proxy_combos) > def test_use_proxy_from_environment(httpbin, var, scheme): > url = "{}://httpbin.org".format(scheme) > fake_proxy = Server() # do nothing with the requests; just close the socket > with fake_proxy as (host, port): > proxy_url = "socks5://{}:{}".format(host, port) > kwargs = {var: proxy_url} > with override_environ(**kwargs): > # fake proxy's lack of response will cause a ConnectionError > with pytest.raises(requests.exceptions.ConnectionError): > requests.get(url) > > # the fake proxy received a request >> assert len(fake_proxy.handler_results) == 1 >E assert 0 == 1 >E -0 >E +1 > >tests/test_lowlevel.py:202: AssertionError >___________________________ test_use_proxy_from_environment[all_proxy-http] ____________________________ > >httpbin = <function inner at 0x3fffb0efcf50>, var = 'all_proxy', scheme = 'http' > > @pytest.mark.parametrize("var,scheme", _proxy_combos) > def test_use_proxy_from_environment(httpbin, var, scheme): > url = "{}://httpbin.org".format(scheme) > fake_proxy = Server() # do nothing with the requests; just close the socket > with fake_proxy as (host, port): > proxy_url = "socks5://{}:{}".format(host, port) > kwargs = {var: proxy_url} > with override_environ(**kwargs): > # fake proxy's lack of response will cause a ConnectionError > with pytest.raises(requests.exceptions.ConnectionError): > requests.get(url) > > # the fake proxy received a request >> assert len(fake_proxy.handler_results) == 1 >E assert 0 == 1 >E -0 >E +1 > >tests/test_lowlevel.py:202: AssertionError >___________________________ test_use_proxy_from_environment[all_proxy-https] ___________________________ > >httpbin = <function inner at 0x3fffb0efc8d0>, var = 'all_proxy', scheme = 'https' > > @pytest.mark.parametrize("var,scheme", _proxy_combos) > def test_use_proxy_from_environment(httpbin, var, scheme): > url = "{}://httpbin.org".format(scheme) > fake_proxy = Server() # do nothing with the requests; just close the socket > with fake_proxy as (host, port): > proxy_url = "socks5://{}:{}".format(host, port) > kwargs = {var: proxy_url} > with override_environ(**kwargs): > # fake proxy's lack of response will cause a ConnectionError > with pytest.raises(requests.exceptions.ConnectionError): > requests.get(url) > > # the fake proxy received a request >> assert len(fake_proxy.handler_results) == 1 >E assert 0 == 1 >E -0 >E +1 > >tests/test_lowlevel.py:202: AssertionError >___________________________ test_use_proxy_from_environment[HTTP_PROXY-http] ___________________________ > >httpbin = <function inner at 0x3fffb0efcd50>, var = 'HTTP_PROXY', scheme = 'http' > > @pytest.mark.parametrize("var,scheme", _proxy_combos) > def test_use_proxy_from_environment(httpbin, var, scheme): > url = "{}://httpbin.org".format(scheme) > fake_proxy = Server() # do nothing with the requests; just close the socket > with fake_proxy as (host, port): > proxy_url = "socks5://{}:{}".format(host, port) > kwargs = {var: proxy_url} > with override_environ(**kwargs): > # fake proxy's lack of response will cause a ConnectionError > with pytest.raises(requests.exceptions.ConnectionError): > requests.get(url) > > # the fake proxy received a request >> assert len(fake_proxy.handler_results) == 1 >E assert 0 == 1 >E -0 >E +1 > >tests/test_lowlevel.py:202: AssertionError >__________________________ test_use_proxy_from_environment[HTTPS_PROXY-https] __________________________ > >httpbin = <function inner at 0x3fffb083f750>, var = 'HTTPS_PROXY', scheme = 'https' > > @pytest.mark.parametrize("var,scheme", _proxy_combos) > def test_use_proxy_from_environment(httpbin, var, scheme): > url = "{}://httpbin.org".format(scheme) > fake_proxy = Server() # do nothing with the requests; just close the socket > with fake_proxy as (host, port): > proxy_url = "socks5://{}:{}".format(host, port) > kwargs = {var: proxy_url} > with override_environ(**kwargs): > # fake proxy's lack of response will cause a ConnectionError > with pytest.raises(requests.exceptions.ConnectionError): > requests.get(url) > > # the fake proxy received a request >> assert len(fake_proxy.handler_results) == 1 >E assert 0 == 1 >E -0 >E +1 > >tests/test_lowlevel.py:202: AssertionError >___________________________ test_use_proxy_from_environment[ALL_PROXY-http] ____________________________ > >httpbin = <function inner at 0x3fffb0efce50>, var = 'ALL_PROXY', scheme = 'http' > > @pytest.mark.parametrize("var,scheme", _proxy_combos) > def test_use_proxy_from_environment(httpbin, var, scheme): > url = "{}://httpbin.org".format(scheme) > fake_proxy = Server() # do nothing with the requests; just close the socket > with fake_proxy as (host, port): > proxy_url = "socks5://{}:{}".format(host, port) > kwargs = {var: proxy_url} > with override_environ(**kwargs): > # fake proxy's lack of response will cause a ConnectionError > with pytest.raises(requests.exceptions.ConnectionError): > requests.get(url) > > # the fake proxy received a request >> assert len(fake_proxy.handler_results) == 1 >E assert 0 == 1 >E -0 >E +1 > >tests/test_lowlevel.py:202: AssertionError >___________________________ test_use_proxy_from_environment[ALL_PROXY-https] ___________________________ > >httpbin = <function inner at 0x3fffb0efccd0>, var = 'ALL_PROXY', scheme = 'https' > > @pytest.mark.parametrize("var,scheme", _proxy_combos) > def test_use_proxy_from_environment(httpbin, var, scheme): > url = "{}://httpbin.org".format(scheme) > fake_proxy = Server() # do nothing with the requests; just close the socket > with fake_proxy as (host, port): > proxy_url = "socks5://{}:{}".format(host, port) > kwargs = {var: proxy_url} > with override_environ(**kwargs): > # fake proxy's lack of response will cause a ConnectionError > with pytest.raises(requests.exceptions.ConnectionError): > requests.get(url) > > # the fake proxy received a request >> assert len(fake_proxy.handler_results) == 1 >E assert 0 == 1 >E -0 >E +1 > >tests/test_lowlevel.py:202: AssertionError >_____________________________ test_redirect_rfc1808_to_non_ascii_location ______________________________ > > def test_redirect_rfc1808_to_non_ascii_location(): > path = u'Å¡' > expected_path = b'%C5%A1' > redirect_request = [] # stores the second request to the server > > def redirect_resp_handler(sock): > consume_socket_content(sock, timeout=0.5) > location = u'//{}:{}/{}'.format(host, port, path) > sock.send( > b'HTTP/1.1 301 Moved Permanently\r\n' > b'Content-Length: 0\r\n' > b'Location: ' + location.encode('utf8') + b'\r\n' > b'\r\n' > ) > redirect_request.append(consume_socket_content(sock, timeout=0.5)) > sock.send(b'HTTP/1.1 200 OK\r\n\r\n') > > close_server = threading.Event() > server = Server(redirect_resp_handler, wait_to_close_event=close_server) > > with server as (host, port): > url = u'http://{}:{}'.format(host, port) >> r = requests.get(url=url, allow_redirects=True) > >tests/test_lowlevel.py:230: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >requests/api.py:76: in get > return request('get', url, params=params, **kwargs) >requests/api.py:61: in request > return session.request(method=method, url=url, **kwargs) >requests/sessions.py:530: in request > resp = self.send(prep, **send_kwargs) >requests/sessions.py:643: in send > r = adapter.send(request, **kwargs) >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <requests.adapters.HTTPAdapter object at 0x3fffb0778950>, request = <PreparedRequest [GET]> >stream = False, timeout = <urllib3.util.timeout.Timeout object at 0x3fffb0778e50>, verify = True >cert = None, proxies = OrderedDict() > > def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None): > """Sends PreparedRequest object. Returns Response object. > > :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. > :param stream: (optional) Whether to stream the request content. > :param timeout: (optional) How long to wait for the server to send > data before giving up, as a float, or a :ref:`(connect timeout, > read timeout) <timeouts>` tuple. > :type timeout: float or tuple or urllib3 Timeout object > :param verify: (optional) Either a boolean, in which case it controls whether > we verify the server's TLS certificate, or a string, in which case it > must be a path to a CA bundle to use > :param cert: (optional) Any user-provided SSL certificate to be trusted. > :param proxies: (optional) The proxies dictionary to apply to the request. > :rtype: requests.Response > """ > > try: > conn = self.get_connection(request.url, proxies) > except LocationValueError as e: > raise InvalidURL(e, request=request) > > self.cert_verify(conn, request.url, verify, cert) > url = self.request_url(request, proxies) > self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) > > chunked = not (request.body is None or 'Content-Length' in request.headers) > > if isinstance(timeout, tuple): > try: > connect, read = timeout > timeout = TimeoutSauce(connect=connect, read=read) > except ValueError as e: > # this may raise a string formatting error. > err = ("Invalid timeout {}. Pass a (connect, read) " > "timeout tuple, or a single float to set " > "both timeouts to the same value".format(timeout)) > raise ValueError(err) > elif isinstance(timeout, TimeoutSauce): > pass > else: > timeout = TimeoutSauce(connect=timeout, read=timeout) > > try: > if not chunked: > resp = conn.urlopen( > method=request.method, > url=url, > body=request.body, > headers=request.headers, > redirect=False, > assert_same_host=False, > preload_content=False, > decode_content=False, > retries=self.max_retries, > timeout=timeout > ) > > # Send the request. > else: > if hasattr(conn, 'proxy_pool'): > conn = conn.proxy_pool > > low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT) > > try: > low_conn.putrequest(request.method, > url, > skip_accept_encoding=True) > > for header, value in request.headers.items(): > low_conn.putheader(header, value) > > low_conn.endheaders() > > for i in request.body: > low_conn.send(hex(len(i))[2:].encode('utf-8')) > low_conn.send(b'\r\n') > low_conn.send(i) > low_conn.send(b'\r\n') > low_conn.send(b'0\r\n\r\n') > > # Receive the response from the server > try: > # For Python 2.7, use buffering of HTTP responses > r = low_conn.getresponse(buffering=True) > except TypeError: > # For compatibility with Python 3.3+ > r = low_conn.getresponse() > > resp = HTTPResponse.from_httplib( > r, > pool=conn, > connection=low_conn, > preload_content=False, > decode_content=False > ) > except: > # If we hit any problems here, clean up the connection. > # Then, reraise so that we can handle the actual exception. > low_conn.close() > raise > > except (ProtocolError, socket.error) as err: > raise ConnectionError(err, request=request) > > except MaxRetryError as e: > if isinstance(e.reason, ConnectTimeoutError): > # TODO: Remove this in 3.0.0: see #2811 > if not isinstance(e.reason, NewConnectionError): > raise ConnectTimeout(e, request=request) > > if isinstance(e.reason, ResponseError): > raise RetryError(e, request=request) > > if isinstance(e.reason, _ProxyError): > raise ProxyError(e, request=request) > > if isinstance(e.reason, _SSLError): > # This branch is for urllib3 v1.22 and later. > raise SSLError(e, request=request) > >> raise ConnectionError(e, request=request) >E ConnectionError: HTTPConnectionPool(host='localhost', port=34007): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x3fffb0737050>: Failed to establish a new connection: [Errno 111] Connection refused',)) > >requests/adapters.py:516: ConnectionError >_________________________________ test_fragment_not_sent_with_request __________________________________ > > def test_fragment_not_sent_with_request(): > """Verify that the fragment portion of a URI isn't sent to the server.""" > def response_handler(sock): > req = consume_socket_content(sock, timeout=0.5) > sock.send( > b'HTTP/1.1 200 OK\r\n' > b'Content-Length: '+bytes(len(req))+b'\r\n' > b'\r\n'+req > ) > > close_server = threading.Event() > server = Server(response_handler, wait_to_close_event=close_server) > > with server as (host, port): > url = 'http://{}:{}/path/to/thing/#view=edit&token=hunter2'.format(host, port) >> r = requests.get(url) > >tests/test_lowlevel.py:254: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >requests/api.py:76: in get > return request('get', url, params=params, **kwargs) >requests/api.py:61: in request > return session.request(method=method, url=url, **kwargs) >requests/sessions.py:530: in request > resp = self.send(prep, **send_kwargs) >requests/sessions.py:643: in send > r = adapter.send(request, **kwargs) >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <requests.adapters.HTTPAdapter object at 0x3fffb0971d90>, request = <PreparedRequest [GET]> >stream = False, timeout = <urllib3.util.timeout.Timeout object at 0x3fffb0971e90>, verify = True >cert = None, proxies = OrderedDict() > > def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None): > """Sends PreparedRequest object. Returns Response object. > > :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. > :param stream: (optional) Whether to stream the request content. > :param timeout: (optional) How long to wait for the server to send > data before giving up, as a float, or a :ref:`(connect timeout, > read timeout) <timeouts>` tuple. > :type timeout: float or tuple or urllib3 Timeout object > :param verify: (optional) Either a boolean, in which case it controls whether > we verify the server's TLS certificate, or a string, in which case it > must be a path to a CA bundle to use > :param cert: (optional) Any user-provided SSL certificate to be trusted. > :param proxies: (optional) The proxies dictionary to apply to the request. > :rtype: requests.Response > """ > > try: > conn = self.get_connection(request.url, proxies) > except LocationValueError as e: > raise InvalidURL(e, request=request) > > self.cert_verify(conn, request.url, verify, cert) > url = self.request_url(request, proxies) > self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) > > chunked = not (request.body is None or 'Content-Length' in request.headers) > > if isinstance(timeout, tuple): > try: > connect, read = timeout > timeout = TimeoutSauce(connect=connect, read=read) > except ValueError as e: > # this may raise a string formatting error. > err = ("Invalid timeout {}. Pass a (connect, read) " > "timeout tuple, or a single float to set " > "both timeouts to the same value".format(timeout)) > raise ValueError(err) > elif isinstance(timeout, TimeoutSauce): > pass > else: > timeout = TimeoutSauce(connect=timeout, read=timeout) > > try: > if not chunked: > resp = conn.urlopen( > method=request.method, > url=url, > body=request.body, > headers=request.headers, > redirect=False, > assert_same_host=False, > preload_content=False, > decode_content=False, > retries=self.max_retries, > timeout=timeout > ) > > # Send the request. > else: > if hasattr(conn, 'proxy_pool'): > conn = conn.proxy_pool > > low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT) > > try: > low_conn.putrequest(request.method, > url, > skip_accept_encoding=True) > > for header, value in request.headers.items(): > low_conn.putheader(header, value) > > low_conn.endheaders() > > for i in request.body: > low_conn.send(hex(len(i))[2:].encode('utf-8')) > low_conn.send(b'\r\n') > low_conn.send(i) > low_conn.send(b'\r\n') > low_conn.send(b'0\r\n\r\n') > > # Receive the response from the server > try: > # For Python 2.7, use buffering of HTTP responses > r = low_conn.getresponse(buffering=True) > except TypeError: > # For compatibility with Python 3.3+ > r = low_conn.getresponse() > > resp = HTTPResponse.from_httplib( > r, > pool=conn, > connection=low_conn, > preload_content=False, > decode_content=False > ) > except: > # If we hit any problems here, clean up the connection. > # Then, reraise so that we can handle the actual exception. > low_conn.close() > raise > > except (ProtocolError, socket.error) as err: > raise ConnectionError(err, request=request) > > except MaxRetryError as e: > if isinstance(e.reason, ConnectTimeoutError): > # TODO: Remove this in 3.0.0: see #2811 > if not isinstance(e.reason, NewConnectionError): > raise ConnectTimeout(e, request=request) > > if isinstance(e.reason, ResponseError): > raise RetryError(e, request=request) > > if isinstance(e.reason, _ProxyError): > raise ProxyError(e, request=request) > > if isinstance(e.reason, _SSLError): > # This branch is for urllib3 v1.22 and later. > raise SSLError(e, request=request) > >> raise ConnectionError(e, request=request) >E ConnectionError: HTTPConnectionPool(host='localhost', port=42695): Max retries exceeded with url: /path/to/thing/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x3fffb08c8150>: Failed to establish a new connection: [Errno 111] Connection refused',)) > >requests/adapters.py:516: ConnectionError >___________________________________ test_fragment_update_on_redirect ___________________________________ > > def test_fragment_update_on_redirect(): > """Verify we only append previous fragment if one doesn't exist on new > location. If a new fragment is encountered in a Location header, it should > be added to all subsequent requests. > """ > > def response_handler(sock): > consume_socket_content(sock, timeout=0.5) > sock.send( > b'HTTP/1.1 302 FOUND\r\n' > b'Content-Length: 0\r\n' > b'Location: /get#relevant-section\r\n\r\n' > ) > consume_socket_content(sock, timeout=0.5) > sock.send( > b'HTTP/1.1 302 FOUND\r\n' > b'Content-Length: 0\r\n' > b'Location: /final-url/\r\n\r\n' > ) > consume_socket_content(sock, timeout=0.5) > sock.send( > b'HTTP/1.1 200 OK\r\n\r\n' > ) > > close_server = threading.Event() > server = Server(response_handler, wait_to_close_event=close_server) > > with server as (host, port): > url = 'http://{}:{}/path/to/thing/#view=edit&token=hunter2'.format(host, port) >> r = requests.get(url) > >tests/test_lowlevel.py:297: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >requests/api.py:76: in get > return request('get', url, params=params, **kwargs) >requests/api.py:61: in request > return session.request(method=method, url=url, **kwargs) >requests/sessions.py:530: in request > resp = self.send(prep, **send_kwargs) >requests/sessions.py:643: in send > r = adapter.send(request, **kwargs) >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <requests.adapters.HTTPAdapter object at 0x3fffb09d3350>, request = <PreparedRequest [GET]> >stream = False, timeout = <urllib3.util.timeout.Timeout object at 0x3fffb09d33d0>, verify = True >cert = None, proxies = OrderedDict() > > def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None): > """Sends PreparedRequest object. Returns Response object. > > :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. > :param stream: (optional) Whether to stream the request content. > :param timeout: (optional) How long to wait for the server to send > data before giving up, as a float, or a :ref:`(connect timeout, > read timeout) <timeouts>` tuple. > :type timeout: float or tuple or urllib3 Timeout object > :param verify: (optional) Either a boolean, in which case it controls whether > we verify the server's TLS certificate, or a string, in which case it > must be a path to a CA bundle to use > :param cert: (optional) Any user-provided SSL certificate to be trusted. > :param proxies: (optional) The proxies dictionary to apply to the request. > :rtype: requests.Response > """ > > try: > conn = self.get_connection(request.url, proxies) > except LocationValueError as e: > raise InvalidURL(e, request=request) > > self.cert_verify(conn, request.url, verify, cert) > url = self.request_url(request, proxies) > self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) > > chunked = not (request.body is None or 'Content-Length' in request.headers) > > if isinstance(timeout, tuple): > try: > connect, read = timeout > timeout = TimeoutSauce(connect=connect, read=read) > except ValueError as e: > # this may raise a string formatting error. > err = ("Invalid timeout {}. Pass a (connect, read) " > "timeout tuple, or a single float to set " > "both timeouts to the same value".format(timeout)) > raise ValueError(err) > elif isinstance(timeout, TimeoutSauce): > pass > else: > timeout = TimeoutSauce(connect=timeout, read=timeout) > > try: > if not chunked: > resp = conn.urlopen( > method=request.method, > url=url, > body=request.body, > headers=request.headers, > redirect=False, > assert_same_host=False, > preload_content=False, > decode_content=False, > retries=self.max_retries, > timeout=timeout > ) > > # Send the request. > else: > if hasattr(conn, 'proxy_pool'): > conn = conn.proxy_pool > > low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT) > > try: > low_conn.putrequest(request.method, > url, > skip_accept_encoding=True) > > for header, value in request.headers.items(): > low_conn.putheader(header, value) > > low_conn.endheaders() > > for i in request.body: > low_conn.send(hex(len(i))[2:].encode('utf-8')) > low_conn.send(b'\r\n') > low_conn.send(i) > low_conn.send(b'\r\n') > low_conn.send(b'0\r\n\r\n') > > # Receive the response from the server > try: > # For Python 2.7, use buffering of HTTP responses > r = low_conn.getresponse(buffering=True) > except TypeError: > # For compatibility with Python 3.3+ > r = low_conn.getresponse() > > resp = HTTPResponse.from_httplib( > r, > pool=conn, > connection=low_conn, > preload_content=False, > decode_content=False > ) > except: > # If we hit any problems here, clean up the connection. > # Then, reraise so that we can handle the actual exception. > low_conn.close() > raise > > except (ProtocolError, socket.error) as err: > raise ConnectionError(err, request=request) > > except MaxRetryError as e: > if isinstance(e.reason, ConnectTimeoutError): > # TODO: Remove this in 3.0.0: see #2811 > if not isinstance(e.reason, NewConnectionError): > raise ConnectTimeout(e, request=request) > > if isinstance(e.reason, ResponseError): > raise RetryError(e, request=request) > > if isinstance(e.reason, _ProxyError): > raise ProxyError(e, request=request) > > if isinstance(e.reason, _SSLError): > # This branch is for urllib3 v1.22 and later. > raise SSLError(e, request=request) > >> raise ConnectionError(e, request=request) >E ConnectionError: HTTPConnectionPool(host='localhost', port=40295): Max retries exceeded with url: /path/to/thing/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x3fffb07cf350>: Failed to establish a new connection: [Errno 111] Connection refused',)) > >requests/adapters.py:516: ConnectionError >______________________________________ TestTestServer.test_basic _______________________________________ > >self = <tests.test_testserver.TestTestServer instance at 0x3fffb03f42d0> > > def test_basic(self): > """messages are sent and received properly""" > question = b"success?" > answer = b"yeah, success" > > def handler(sock): > text = sock.recv(1000) > assert text == question > sock.sendall(answer) > > with Server(handler) as (host, port): > sock = socket.socket() >> sock.connect((host, port)) > >tests/test_testserver.py:26: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >name = 'connect', self = <socket._socketobject object at 0x3fffb0eda670>, args = (('localhost', 51009),) > > def meth(name,self,*args): >> return getattr(self._sock,name)(*args) >E error: [Errno 111] Connection refused > >/usr/lib64/python2.7/socket.py:228: error >__________________________________ TestTestServer.test_server_closes ___________________________________ > >self = <tests.test_testserver.TestTestServer instance at 0x3fffb1620370> > > def test_server_closes(self): > """the server closes when leaving the context manager""" > with Server.basic_response_server() as (host, port): > sock = socket.socket() >> sock.connect((host, port)) > >tests/test_testserver.py:36: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >name = 'connect', self = <socket._socketobject object at 0x3fffb1189d00>, args = (('localhost', 41355),) > > def meth(name,self,*args): >> return getattr(self._sock,name)(*args) >E error: [Errno 111] Connection refused > >/usr/lib64/python2.7/socket.py:228: error >__________________________________ TestTestServer.test_text_response ___________________________________ > >self = <tests.test_testserver.TestTestServer instance at 0x3fffb03e5500> > > def test_text_response(self): > """the text_response_server sends the given text""" > server = Server.text_response_server( > "HTTP/1.1 200 OK\r\n" + > "Content-Length: 6\r\n" + > "\r\nroflol" > ) > > with server as (host, port): >> r = requests.get('http://{}:{}'.format(host, port)) > >tests/test_testserver.py:53: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >requests/api.py:76: in get > return request('get', url, params=params, **kwargs) >requests/api.py:61: in request > return session.request(method=method, url=url, **kwargs) >requests/sessions.py:530: in request > resp = self.send(prep, **send_kwargs) >requests/sessions.py:643: in send > r = adapter.send(request, **kwargs) >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <requests.adapters.HTTPAdapter object at 0x3fffb073ca50>, request = <PreparedRequest [GET]> >stream = False, timeout = <urllib3.util.timeout.Timeout object at 0x3fffb073c690>, verify = True >cert = None, proxies = OrderedDict() > > def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None): > """Sends PreparedRequest object. Returns Response object. > > :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. > :param stream: (optional) Whether to stream the request content. > :param timeout: (optional) How long to wait for the server to send > data before giving up, as a float, or a :ref:`(connect timeout, > read timeout) <timeouts>` tuple. > :type timeout: float or tuple or urllib3 Timeout object > :param verify: (optional) Either a boolean, in which case it controls whether > we verify the server's TLS certificate, or a string, in which case it > must be a path to a CA bundle to use > :param cert: (optional) Any user-provided SSL certificate to be trusted. > :param proxies: (optional) The proxies dictionary to apply to the request. > :rtype: requests.Response > """ > > try: > conn = self.get_connection(request.url, proxies) > except LocationValueError as e: > raise InvalidURL(e, request=request) > > self.cert_verify(conn, request.url, verify, cert) > url = self.request_url(request, proxies) > self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) > > chunked = not (request.body is None or 'Content-Length' in request.headers) > > if isinstance(timeout, tuple): > try: > connect, read = timeout > timeout = TimeoutSauce(connect=connect, read=read) > except ValueError as e: > # this may raise a string formatting error. > err = ("Invalid timeout {}. Pass a (connect, read) " > "timeout tuple, or a single float to set " > "both timeouts to the same value".format(timeout)) > raise ValueError(err) > elif isinstance(timeout, TimeoutSauce): > pass > else: > timeout = TimeoutSauce(connect=timeout, read=timeout) > > try: > if not chunked: > resp = conn.urlopen( > method=request.method, > url=url, > body=request.body, > headers=request.headers, > redirect=False, > assert_same_host=False, > preload_content=False, > decode_content=False, > retries=self.max_retries, > timeout=timeout > ) > > # Send the request. > else: > if hasattr(conn, 'proxy_pool'): > conn = conn.proxy_pool > > low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT) > > try: > low_conn.putrequest(request.method, > url, > skip_accept_encoding=True) > > for header, value in request.headers.items(): > low_conn.putheader(header, value) > > low_conn.endheaders() > > for i in request.body: > low_conn.send(hex(len(i))[2:].encode('utf-8')) > low_conn.send(b'\r\n') > low_conn.send(i) > low_conn.send(b'\r\n') > low_conn.send(b'0\r\n\r\n') > > # Receive the response from the server > try: > # For Python 2.7, use buffering of HTTP responses > r = low_conn.getresponse(buffering=True) > except TypeError: > # For compatibility with Python 3.3+ > r = low_conn.getresponse() > > resp = HTTPResponse.from_httplib( > r, > pool=conn, > connection=low_conn, > preload_content=False, > decode_content=False > ) > except: > # If we hit any problems here, clean up the connection. > # Then, reraise so that we can handle the actual exception. > low_conn.close() > raise > > except (ProtocolError, socket.error) as err: > raise ConnectionError(err, request=request) > > except MaxRetryError as e: > if isinstance(e.reason, ConnectTimeoutError): > # TODO: Remove this in 3.0.0: see #2811 > if not isinstance(e.reason, NewConnectionError): > raise ConnectTimeout(e, request=request) > > if isinstance(e.reason, ResponseError): > raise RetryError(e, request=request) > > if isinstance(e.reason, _ProxyError): > raise ProxyError(e, request=request) > > if isinstance(e.reason, _SSLError): > # This branch is for urllib3 v1.22 and later. > raise SSLError(e, request=request) > >> raise ConnectionError(e, request=request) >E ConnectionError: HTTPConnectionPool(host='localhost', port=45335): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x3fffb0745f10>: Failed to establish a new connection: [Errno 111] Connection refused',)) > >requests/adapters.py:516: ConnectionError >__________________________________ TestTestServer.test_basic_response __________________________________ > >self = <tests.test_testserver.TestTestServer instance at 0x3fffb09391e0> > > def test_basic_response(self): > """the basic response server returns an empty http response""" > with Server.basic_response_server() as (host, port): >> r = requests.get('http://{}:{}'.format(host, port)) > >tests/test_testserver.py:62: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >requests/api.py:76: in get > return request('get', url, params=params, **kwargs) >requests/api.py:61: in request > return session.request(method=method, url=url, **kwargs) >requests/sessions.py:530: in request > resp = self.send(prep, **send_kwargs) >requests/sessions.py:643: in send > r = adapter.send(request, **kwargs) >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <requests.adapters.HTTPAdapter object at 0x3fffb1499c90>, request = <PreparedRequest [GET]> >stream = False, timeout = <urllib3.util.timeout.Timeout object at 0x3fffb1499a90>, verify = True >cert = None, proxies = OrderedDict() > > def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None): > """Sends PreparedRequest object. Returns Response object. > > :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. > :param stream: (optional) Whether to stream the request content. > :param timeout: (optional) How long to wait for the server to send > data before giving up, as a float, or a :ref:`(connect timeout, > read timeout) <timeouts>` tuple. > :type timeout: float or tuple or urllib3 Timeout object > :param verify: (optional) Either a boolean, in which case it controls whether > we verify the server's TLS certificate, or a string, in which case it > must be a path to a CA bundle to use > :param cert: (optional) Any user-provided SSL certificate to be trusted. > :param proxies: (optional) The proxies dictionary to apply to the request. > :rtype: requests.Response > """ > > try: > conn = self.get_connection(request.url, proxies) > except LocationValueError as e: > raise InvalidURL(e, request=request) > > self.cert_verify(conn, request.url, verify, cert) > url = self.request_url(request, proxies) > self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) > > chunked = not (request.body is None or 'Content-Length' in request.headers) > > if isinstance(timeout, tuple): > try: > connect, read = timeout > timeout = TimeoutSauce(connect=connect, read=read) > except ValueError as e: > # this may raise a string formatting error. > err = ("Invalid timeout {}. Pass a (connect, read) " > "timeout tuple, or a single float to set " > "both timeouts to the same value".format(timeout)) > raise ValueError(err) > elif isinstance(timeout, TimeoutSauce): > pass > else: > timeout = TimeoutSauce(connect=timeout, read=timeout) > > try: > if not chunked: > resp = conn.urlopen( > method=request.method, > url=url, > body=request.body, > headers=request.headers, > redirect=False, > assert_same_host=False, > preload_content=False, > decode_content=False, > retries=self.max_retries, > timeout=timeout > ) > > # Send the request. > else: > if hasattr(conn, 'proxy_pool'): > conn = conn.proxy_pool > > low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT) > > try: > low_conn.putrequest(request.method, > url, > skip_accept_encoding=True) > > for header, value in request.headers.items(): > low_conn.putheader(header, value) > > low_conn.endheaders() > > for i in request.body: > low_conn.send(hex(len(i))[2:].encode('utf-8')) > low_conn.send(b'\r\n') > low_conn.send(i) > low_conn.send(b'\r\n') > low_conn.send(b'0\r\n\r\n') > > # Receive the response from the server > try: > # For Python 2.7, use buffering of HTTP responses > r = low_conn.getresponse(buffering=True) > except TypeError: > # For compatibility with Python 3.3+ > r = low_conn.getresponse() > > resp = HTTPResponse.from_httplib( > r, > pool=conn, > connection=low_conn, > preload_content=False, > decode_content=False > ) > except: > # If we hit any problems here, clean up the connection. > # Then, reraise so that we can handle the actual exception. > low_conn.close() > raise > > except (ProtocolError, socket.error) as err: > raise ConnectionError(err, request=request) > > except MaxRetryError as e: > if isinstance(e.reason, ConnectTimeoutError): > # TODO: Remove this in 3.0.0: see #2811 > if not isinstance(e.reason, NewConnectionError): > raise ConnectTimeout(e, request=request) > > if isinstance(e.reason, ResponseError): > raise RetryError(e, request=request) > > if isinstance(e.reason, _ProxyError): > raise ProxyError(e, request=request) > > if isinstance(e.reason, _SSLError): > # This branch is for urllib3 v1.22 and later. > raise SSLError(e, request=request) > >> raise ConnectionError(e, request=request) >E ConnectionError: HTTPConnectionPool(host='localhost', port=32987): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x3fffb06a4e10>: Failed to establish a new connection: [Errno 111] Connection refused',)) > >requests/adapters.py:516: ConnectionError >_______________________________ TestTestServer.test_basic_waiting_server _______________________________ > >self = <tests.test_testserver.TestTestServer instance at 0x3fffb117e230> > > def test_basic_waiting_server(self): > """the server waits for the block_server event to be set before closing""" > block_server = threading.Event() > > with Server.basic_response_server(wait_to_close_event=block_server) as (host, port): > sock = socket.socket() >> sock.connect((host, port)) > >tests/test_testserver.py:73: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >name = 'connect', self = <socket._socketobject object at 0x3fffb04b3590>, args = (('localhost', 32819),) > > def meth(name,self,*args): >> return getattr(self._sock,name)(*args) >E error: [Errno 111] Connection refused > >/usr/lib64/python2.7/socket.py:228: error >________________________________ TestTestServer.test_multiple_requests _________________________________ > >self = <tests.test_testserver.TestTestServer instance at 0x3fffb13e2410> > > def test_multiple_requests(self): > """multiple requests can be served""" > requests_to_handle = 5 > > server = Server.basic_response_server(requests_to_handle=requests_to_handle) > > with server as (host, port): > server_url = 'http://{}:{}'.format(host, port) > for _ in range(requests_to_handle): >> r = requests.get(server_url) > >tests/test_testserver.py:88: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >requests/api.py:76: in get > return request('get', url, params=params, **kwargs) >requests/api.py:61: in request > return session.request(method=method, url=url, **kwargs) >requests/sessions.py:530: in request > resp = self.send(prep, **send_kwargs) >requests/sessions.py:643: in send > r = adapter.send(request, **kwargs) >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <requests.adapters.HTTPAdapter object at 0x3fffb070a290>, request = <PreparedRequest [GET]> >stream = False, timeout = <urllib3.util.timeout.Timeout object at 0x3fffb1384790>, verify = True >cert = None, proxies = OrderedDict() > > def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None): > """Sends PreparedRequest object. Returns Response object. > > :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. > :param stream: (optional) Whether to stream the request content. > :param timeout: (optional) How long to wait for the server to send > data before giving up, as a float, or a :ref:`(connect timeout, > read timeout) <timeouts>` tuple. > :type timeout: float or tuple or urllib3 Timeout object > :param verify: (optional) Either a boolean, in which case it controls whether > we verify the server's TLS certificate, or a string, in which case it > must be a path to a CA bundle to use > :param cert: (optional) Any user-provided SSL certificate to be trusted. > :param proxies: (optional) The proxies dictionary to apply to the request. > :rtype: requests.Response > """ > > try: > conn = self.get_connection(request.url, proxies) > except LocationValueError as e: > raise InvalidURL(e, request=request) > > self.cert_verify(conn, request.url, verify, cert) > url = self.request_url(request, proxies) > self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) > > chunked = not (request.body is None or 'Content-Length' in request.headers) > > if isinstance(timeout, tuple): > try: > connect, read = timeout > timeout = TimeoutSauce(connect=connect, read=read) > except ValueError as e: > # this may raise a string formatting error. > err = ("Invalid timeout {}. Pass a (connect, read) " > "timeout tuple, or a single float to set " > "both timeouts to the same value".format(timeout)) > raise ValueError(err) > elif isinstance(timeout, TimeoutSauce): > pass > else: > timeout = TimeoutSauce(connect=timeout, read=timeout) > > try: > if not chunked: > resp = conn.urlopen( > method=request.method, > url=url, > body=request.body, > headers=request.headers, > redirect=False, > assert_same_host=False, > preload_content=False, > decode_content=False, > retries=self.max_retries, > timeout=timeout > ) > > # Send the request. > else: > if hasattr(conn, 'proxy_pool'): > conn = conn.proxy_pool > > low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT) > > try: > low_conn.putrequest(request.method, > url, > skip_accept_encoding=True) > > for header, value in request.headers.items(): > low_conn.putheader(header, value) > > low_conn.endheaders() > > for i in request.body: > low_conn.send(hex(len(i))[2:].encode('utf-8')) > low_conn.send(b'\r\n') > low_conn.send(i) > low_conn.send(b'\r\n') > low_conn.send(b'0\r\n\r\n') > > # Receive the response from the server > try: > # For Python 2.7, use buffering of HTTP responses > r = low_conn.getresponse(buffering=True) > except TypeError: > # For compatibility with Python 3.3+ > r = low_conn.getresponse() > > resp = HTTPResponse.from_httplib( > r, > pool=conn, > connection=low_conn, > preload_content=False, > decode_content=False > ) > except: > # If we hit any problems here, clean up the connection. > # Then, reraise so that we can handle the actual exception. > low_conn.close() > raise > > except (ProtocolError, socket.error) as err: > raise ConnectionError(err, request=request) > > except MaxRetryError as e: > if isinstance(e.reason, ConnectTimeoutError): > # TODO: Remove this in 3.0.0: see #2811 > if not isinstance(e.reason, NewConnectionError): > raise ConnectTimeout(e, request=request) > > if isinstance(e.reason, ResponseError): > raise RetryError(e, request=request) > > if isinstance(e.reason, _ProxyError): > raise ProxyError(e, request=request) > > if isinstance(e.reason, _SSLError): > # This branch is for urllib3 v1.22 and later. > raise SSLError(e, request=request) > >> raise ConnectionError(e, request=request) >E ConnectionError: HTTPConnectionPool(host='localhost', port=55145): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x3fffb1384910>: Failed to establish a new connection: [Errno 111] Connection refused',)) > >requests/adapters.py:516: ConnectionError >_____________________ TestTestServer.test_requests_after_timeout_are_not_received ______________________ > >self = <tests.test_testserver.TestTestServer instance at 0x3fffb08732d0> > > def test_requests_after_timeout_are_not_received(self): > """the basic response handler times out when receiving requests""" > server = Server.basic_response_server(request_timeout=1) > > with server as address: > sock = socket.socket() >> sock.connect(address) > >tests/test_testserver.py:124: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >name = 'connect', self = <socket._socketobject object at 0x3fffb0498130>, args = (('localhost', 35085),) > > def meth(name,self,*args): >> return getattr(self._sock,name)(*args) >E error: [Errno 111] Connection refused > >/usr/lib64/python2.7/socket.py:228: error >_______________________ TestTestServer.test_request_recovery_with_bigger_timeout _______________________ > >self = <tests.test_testserver.TestTestServer instance at 0x3fffb0857050> > > def test_request_recovery_with_bigger_timeout(self): > """a biggest timeout can be specified""" > server = Server.basic_response_server(request_timeout=3) > data = b'bananadine' > > with server as address: > sock = socket.socket() >> sock.connect(address) > >tests/test_testserver.py:138: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >name = 'connect', self = <socket._socketobject object at 0x3fffb0498ec0>, args = (('localhost', 53671),) > > def meth(name,self,*args): >> return getattr(self._sock,name)(*args) >E error: [Errno 111] Connection refused > >/usr/lib64/python2.7/socket.py:228: error >=========================================== warnings summary =========================================== >/usr/lib64/python2.7/site-packages/_pytest/config/__init__.py:781 > /usr/lib64/python2.7/site-packages/_pytest/config/__init__.py:781: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: backports > self._mark_plugins_for_rewrite(hook) > >-- Docs: https://docs.pytest.org/en/latest/warnings.html >============== 23 failed, 504 passed, 11 skipped, 1 xfailed, 1 warnings in 279.35 seconds ============== > [31;01m*[0m ERROR: dev-python/requests-2.23.0::gentoo failed (test phase): > [31;01m*[0m Tests failed with python2.7 > [31;01m*[0m > [31;01m*[0m Call stack: > [31;01m*[0m ebuild.sh, line 125: Called src_test > [31;01m*[0m environment, line 2933: Called distutils-r1_src_test > [31;01m*[0m environment, line 1276: Called _distutils-r1_run_foreach_impl 'python_test' > [31;01m*[0m environment, line 476: Called python_foreach_impl 'distutils-r1_run_phase' 'python_test' > [31;01m*[0m environment, line 2545: Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test' > [31;01m*[0m environment, line 2058: Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test' > [31;01m*[0m environment, line 2056: Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_test' > [31;01m*[0m environment, line 864: Called distutils-r1_run_phase 'python_test' > [31;01m*[0m environment, line 1213: Called python_test > [31;01m*[0m environment, line 2890: Called die > [31;01m*[0m The specific snippet of code: > [31;01m*[0m pytest -vv || die "Tests failed with ${EPYTHON}" > [31;01m*[0m > [31;01m*[0m If you need support, post the output of `emerge --info '=dev-python/requests-2.23.0::gentoo'`, > [31;01m*[0m the complete build log and the output of `emerge -pqv '=dev-python/requests-2.23.0::gentoo'`. > [31;01m*[0m The complete build log is located at '/var/log/portage/build/dev-python/requests-2.23.0:20200331-071817.log'. > [31;01m*[0m For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-python/requests-2.23.0/temp/build.log'. > [31;01m*[0m The ebuild environment file is located at '/var/tmp/portage/dev-python/requests-2.23.0/temp/environment'. > [31;01m*[0m Working directory: '/var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0' > [31;01m*[0m S: '/var/tmp/portage/dev-python/requests-2.23.0/work/requests-2.23.0'
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 715584
: 627876 |
627878
|
690714