#1 When allow_net_connect = False, a request that otherwise ... WARNING:tornado.access:404 GET / (::1) 3.92ms real call to socket.connect() for ('localhost', 34089) passed #2 When allow_net_connect = False, a request that would have ... httpretty.core.socket("example.com:80").real_sendall(123 bytes) to http://example.com/nonsense via GET at 1642373301.599276 passed #3 When allow_net_connect = False, mocked requests still work correctly. ... passed #4 httpretty should bypass a unregistered request by disabling it ... WARNING:tornado.access:404 GET / (::1) 4.46ms httpretty.core.socket("localhost:53255").real_sendall(130 bytes) to http://localhost:53255/come-again/ via GET at 1642373302.8604205 real call to socket.connect() for passed #5 httpretty should bypass all requests by disabling it ... WARNING:tornado.access:404 GET / (::1) 3.61ms passed #6 httpretty should work even when testing code that also use other TCP-based protocols ... passed #7 HTTPretty should forward_and_trace socket.recv_into ... skipped #8 HTTPretty should forward_and_trace socket.recvfrom ... skipped #9 HTTPretty should forward_and_trace socket.recvfrom_into ... skipped #10 HTTPretty should forward_and_trace socket.send ... skipped #11 HTTPretty should forward_and_trace socket.sendto ... skipped #12 test_decorated (tests.functional.test_decorator.ClassDecorator) ... passed #13 test_decorated2 (tests.functional.test_decorator.ClassDecorator) ... passed #14 test_decorated (tests.functional.test_decorator.ClassDecoratorWithSetUp) ... passed #15 test_decorated2 (tests.functional.test_decorator.ClassDecoratorWithSetUp) ... passed #16 test_decorated (tests.functional.test_decorator.NonUnitTestTest) ... passed #17 tests.functional.test_decorator.test_decor ... passed #18 HTTPretty should call a callback function to be set as the body with httplib2 ... passed #19 HTTPretty.last_request is a mimetools.Message request from last match ... passed #20 HTTPretty.last_request is recorded even when mocking 'https' (SSL) ... passed #21 Registering URIs with query string cause them to be ignored ... passed #22 HTTPretty should provide an easy access to the querystring ... passed #23 HTTPretty should allow adding and overwritting headers by keyword args with httplib2 ... passed #24 HTTPretty should allow adding and overwritting headers with httplib2 ... passed #25 HTTPretty should allow forcing headers with httplib2 ... passed #26 HTTPretty should allow registering regexes with httplib2 ... passed #27 HTTPretty should mock a simple GET with httplib2.context.http ... passed #28 HTTPretty should mock basic headers with httplib2 ... passed #29 HTTPretty should support rotating responses with httplib2 ... passed #30 tests.functional.test_passthrough.test_http_passthrough ... passed #31 tests.functional.test_passthrough.test_https_passthrough ... passed #32 HTTPretty should be able to record calls ... passed #33 HTTPretty should call a callback function more than one requests ... passed #34 HTTPretty should call a callback function and set its return value as the body of the response requests ... passed #35 HTTPretty should call a callback function, use it's return tuple as status code, headers and body requests and respect the content-length header when responding to HEAD ... passed #36 HTTPretty should call a callback function and uses it retur tuple as status code, headers and body requests ... passed #37 HTTPretty.last_request is a mimetools.Message request from last match ... passed #38 HTTPretty.last_request is recorded even when mocking 'https' (SSL) ... passed #39 HTTPretty should match the hostname case insensitive ... passed #40 HTTPretty should provide a way to not match regexes that have a different querystring ... passed #41 HTTPretty should ignore querystrings from the registered uri (requests library) ... passed #42 HTTPretty should provide an easy access to the querystring ... passed #43 HTTPretty should match regexes even if they have a different querystring ... passed #44 HTTPretty should reset protocol/port associations ... passed #45 HTTPretty should allow adding and overwritting headers by keyword args with requests ... passed #46 HTTPretty should allow adding and overwritting headers with requests ... passed #47 HTTPretty should allow forcing headers with requests ... passed #48 HTTPretty should allow registering multiple methods for the same uri ... passed #49 HTTPretty should allow multiple responses when binding multiple methods to the same uri ... passed #50 HTTPretty should allow registering regexes with requests ... passed #51 HTTPretty should allow registering regexes with requests and giva a proper match to the callback ... passed #52 HTTPretty should allow registering regexes with requests and giva a proper match to the callback ... passed #53 HTTPretty should allow registering regexes with streaming responses ... passed #54 HTTPretty should handle URLs with paths starting with // ... passed #55 HTTPretty should mock a simple GET with requests.get ... passed #56 HTTPretty should mock basic headers with requests ... passed #57 HTTPretty should normalize all url patching ... passed #58 tests.functional.test_requests.test_httpretty_should_respect_matcher_priority ... passed #59 HTTPretty should work with a non-standard port number ... passed #60 HTTPretty should automatically append a slash to given urls ... passed #61 tests.functional.test_requests.test_multiline ... passed #62 tests.functional.test_requests.test_multipart ... passed #63 tests.functional.test_requests.test_octet_stream ... passed #64 HTTPretty should call a callback function *once* and set its return value as the body of the response requests ... passed #65 HTTPretty should support rotating responses with requests ... passed #66 Mock a streaming HTTP response, like those returned by the Twitter streaming ... FAILED ====================================================================== 7) SKIP: HTTPretty should forward_and_trace socket.recv_into ---------------------------------------------------------------------- No Traceback SkipTest: not currently supported ====================================================================== 8) SKIP: HTTPretty should forward_and_trace socket.recvfrom ---------------------------------------------------------------------- No Traceback SkipTest: not currently supported ====================================================================== 9) SKIP: HTTPretty should forward_and_trace socket.recvfrom_into ---------------------------------------------------------------------- No Traceback SkipTest: not currently supported ====================================================================== 10) SKIP: HTTPretty should forward_and_trace socket.send ---------------------------------------------------------------------- No Traceback SkipTest: not currently supported ====================================================================== 11) SKIP: HTTPretty should forward_and_trace socket.sendto ---------------------------------------------------------------------- No Traceback SkipTest: not currently supported ====================================================================== 66) FAIL: Mock a streaming HTTP response, like those returned by the Twitter streaming ---------------------------------------------------------------------- Traceback (most recent call last): /usr/lib/python3.10/site-packages/nose/case.py line 197 in runTest self.test(*self.arg) /usr/lib/python3.10/site-packages/nose/util.py line 620 in newfunc return func(*arg, **kw) httpretty/core.py line 2075 in wrapper return test(*args, **kw) /usr/lib/python3.10/site-packages/sure/__init__.py line 223 in wrap raise AssertionError(exc.pop(0)) AssertionError: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/sure/__init__.py", line 197, in wrap func(start, *args, **kw) File "/build/python-httpretty/src/HTTPretty-1.1.4/tests/functional/test_requests.py", line 370, in test_streaming_responses twitter_body = b''.join(c for c in response.iter_content(chunk_size=1)) File "/build/python-httpretty/src/HTTPretty-1.1.4/tests/functional/test_requests.py", line 370, in twitter_body = b''.join(c for c in response.iter_content(chunk_size=1)) File "/usr/lib/python3.10/site-packages/requests/models.py", line 758, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "/usr/lib/python3.10/site-packages/urllib3/response.py", line 579, in stream data = self.read(amt=amt, decode_content=decode_content) File "/usr/lib/python3.10/site-packages/urllib3/response.py", line 515, in read with self._error_catcher(): File "/build/python-httpretty/src/HTTPretty-1.1.4/tests/functional/test_requests.py", line 303, in handler raise AssertionError(message) AssertionError: Iterating by char is taking forever! Name Stmts Miss Branch BrPart Cover --------------------------------------------------------- httpretty/__init__.py 45 3 0 0 93% httpretty/compat.py 17 1 0 0 94% httpretty/core.py 1007 151 310 53 83% httpretty/errors.py 16 0 6 0 100% httpretty/http.py 28 0 4 1 97% httpretty/utils.py 8 0 4 0 100% httpretty/version.py 1 0 0 0 100% --------------------------------------------------------- TOTAL 1122 155 324 54 84% ----------------------------------------------------------------------------- 66 tests run in 12.224 seconds. 1 FAILED, 5 skipped (60 tests passed) 821.05 2000 89.93 2000 363.94 2000 74.02 2000 71.35 2000 46.68 2000 54.84 2000 967.81 2000 346.93 2000 354.34 2000 167.56 2000 357.52 2000 171.98 2000 201.33 2000 159.74 2000 158.28 2000 156.47 2000 141.61 2000 150.29 2000 478.31 2000 880.55 5000 ==> ERROR: A failure occurred in check().  Aborting...