Skip to content

Instantly share code, notes, and snippets.

@loqs
Created September 10, 2023 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loqs/aea684d99623d2298ba630ec5333f1d9 to your computer and use it in GitHub Desktop.
Save loqs/aea684d99623d2298ba630ec5333f1d9 to your computer and use it in GitHub Desktop.
test failures for httpie/cli 2.2.3 with werkzeug 2.3.7
============================= test session starts ==============================
platform linux -- Python 3.11.5, pytest-7.4.2, pluggy-1.3.0
rootdir: /build/httpie/src/cli-3.2.2
configfile: pytest.ini
plugins: httpbin-2.0.0, lazy-fixture-0.6.3, mock-3.11.1
collected 1026 items / 28 deselected / 998 selected
tests/test_auth.py .......... [ 1%]
tests/test_compress.py .FFFFFF [ 1%]
tests/test_downloads.py ...... [ 2%]
tests/test_errors.py .... [ 2%]
tests/test_httpie.py ...........s............... [ 5%]
tests/test_json.py . [ 5%]
tests/test_auth.py .......... [ 6%]
tests/test_compress.py .FFFFFF [ 7%]
tests/test_downloads.py ...... [ 7%]
tests/test_errors.py .... [ 8%]
tests/test_httpie.py ...........s............... [ 10%]
tests/test_json.py . [ 11%]
tests/test_auth.py ......... [ 11%]
tests/test_auth_plugins.py .... [ 12%]
tests/test_binary.py ...FFF [ 12%]
tests/test_cli.py ...................................... [ 16%]
tests/test_cli_ui.py .... [ 17%]
tests/test_cli_utils.py .. [ 17%]
tests/test_compress.py .. [ 17%]
tests/test_config.py ........s [ 18%]
tests/test_cookie.py . [ 18%]
tests/test_cookie_on_redirects.py ..................... [ 20%]
tests/test_defaults.py ................. [ 22%]
tests/test_downloads.py .................... [ 24%]
tests/test_encoding.py ................................................. [ 29%]
.... [ 29%]
tests/test_errors.py .... [ 30%]
tests/test_exit_status.py ......... [ 30%]
tests/test_httpie.py ...................... [ 33%]
tests/test_httpie_cli.py ........................... [ 35%]
tests/test_json.py ..................................................... [ 41%]
........................................................................ [ 48%]
........................................................................ [ 55%]
........................................................................ [ 62%]
....................... [ 65%]
tests/test_meta.py ...... [ 65%]
tests/test_offline.py ......... [ 66%]
tests/test_output.py ..........xXX...................................... [ 71%]
........................................................................ [ 78%]
. [ 79%]
tests/test_parser_schema.py . [ 79%]
tests/test_redirects.py ...x...... [ 80%]
tests/test_regressions.py ... [ 80%]
tests/test_sessions.py ................................................. [ 85%]
............ [ 86%]
tests/test_ssl.py ..pytest-httpbin server hit an exception serving request: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)
attempting to ignore so the rest of the tests can run
.pytest-httpbin server hit an exception serving request: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)
attempting to ignore so the rest of the tests can run
.....pytest-httpbin server hit an exception serving request: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)
attempting to ignore so the rest of the tests can run
........pytest-httpbin server hit an exception serving request: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)
attempting to ignore so the rest of the tests can run
....... [ 88%]
tests/test_stream.py ................ [ 90%]
tests/test_tokens.py ................... [ 92%]
tests/test_transport_plugin.py . [ 92%]
tests/test_update_warnings.py ............ [ 93%]
tests/test_uploads.py ........................ [ 96%]
tests/test_windows.py s. [ 96%]
tests/test_xml.py ................. [ 97%]
tests/utils/matching/test_matching.py .................... [100%]
=================================== FAILURES ===================================
________________ test_compress_force_with_negative_ratio[http] _________________
httpbin_both = <pytest_httpbin.serve.Server object at 0x7f047633d490>
def test_compress_force_with_negative_ratio(httpbin_both):
> r = http(
'--compress',
'--compress',
httpbin_both + '/post',
'foo=bar',
)
tests/test_compress.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
program_name = 'http', tolerate_error_exit_status = False
args = ['--compress', '--compress', 'http://127.0.0.1:46229/post', 'foo=bar']
kwargs = {'env': <MockEnvironment {'args': Namespace(method='POST', url='http://127.0.0.1:46229/post', request_items=[{'key': '...out': <tempfile._TemporaryFileWrapper object at 0x7f04767a0d10>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>}
env = <MockEnvironment {'args': Namespace(method='POST', url='http://127.0.0.1:46229/post', request_items=[{'key': 'foo', 'v...dout': <tempfile._TemporaryFileWrapper object at 0x7f04767a0d10>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>
stdout = <tempfile._TemporaryFileWrapper object at 0x7f04767a0d10>
devnull = <_io.TextIOWrapper name='/dev/null' mode='w+' encoding='UTF-8'>
args_with_config_defaults = ['--compress', '--compress', 'http://127.0.0.1:46229/post', 'foo=bar']
add_to_args = ['--traceback', '--timeout=3']
complete_args = ['http', '--traceback', '--timeout=3', '--compress', '--compress', 'http://127.0.0.1:46229/post', ...]
dump_stderr = <function http.<locals>.dump_stderr at 0x7f04763b7920>
exit_status = <ExitStatus.ERROR_TIMEOUT: 2>
def http(
*args,
program_name='http',
tolerate_error_exit_status=False,
**kwargs,
) -> Union[StrCLIResponse, BytesCLIResponse]:
# noinspection PyUnresolvedReferences
"""
Run HTTPie and capture stderr/out and exit status.
Content written to devnull will be captured only if
env.devnull is set manually.
Invoke `httpie.core.main()` with `args` and `kwargs`,
and return a `CLIResponse` subclass instance.
The return value is either a `StrCLIResponse`, or `BytesCLIResponse`
if unable to decode the output. Devnull is string when possible,
bytes otherwise.
The response has the following attributes:
`stdout` is represented by the instance itself (print r)
`stderr`: text written to stderr
`devnull` text written to devnull.
`exit_status`: the exit status
`json`: decoded JSON (if possible) or `None`
Exceptions are propagated.
If you pass ``tolerate_error_exit_status=True``, then error exit statuses
won't result into an exception.
Example:
$ http --auth=user:password GET pie.dev/basic-auth/user/password
>>> httpbin = getfixture('httpbin')
>>> r = http('-a', 'user:pw', httpbin.url + '/basic-auth/user/pw')
>>> type(r) == StrCLIResponse
True
>>> r.exit_status is ExitStatus.SUCCESS
True
>>> r.stderr
''
>>> 'HTTP/1.1 200 OK' in r
True
>>> r.json == {'authenticated': True, 'user': 'user'}
True
"""
env = kwargs.get('env')
if not env:
env = kwargs['env'] = MockEnvironment()
stdout = env.stdout
stderr = env.stderr
devnull = env.devnull
args = list(args)
args_with_config_defaults = args + env.config.default_options
add_to_args = []
if '--debug' not in args_with_config_defaults:
if (not tolerate_error_exit_status
and '--traceback' not in args_with_config_defaults):
add_to_args.append('--traceback')
if not any('--timeout' in arg for arg in args_with_config_defaults):
add_to_args.append('--timeout=3')
complete_args = [program_name, *add_to_args, *args]
# print(' '.join(complete_args))
def dump_stderr():
stderr.seek(0)
sys.stderr.write(stderr.read())
try:
try:
exit_status = core.main(args=complete_args, **kwargs)
if '--download' in args:
# Let the progress reporter thread finish.
time.sleep(.5)
except SystemExit:
if tolerate_error_exit_status:
exit_status = ExitStatus.ERROR
else:
dump_stderr()
raise
except Exception:
stderr.seek(0)
sys.stderr.write(stderr.read())
raise
else:
if (not tolerate_error_exit_status
and exit_status != ExitStatus.SUCCESS):
dump_stderr()
> raise ExitStatusError(
'httpie.core.main() unexpectedly returned'
f' a non-zero exit status: {exit_status}'
)
E tests.utils.ExitStatusError: httpie.core.main() unexpectedly returned a non-zero exit status: 2
tests/utils/__init__.py:421: ExitStatusError
----------------------------- Captured stderr call -----------------------------
http: error: Request timed out (3.0s).
___________________________ test_compress_json[http] ___________________________
httpbin_both = <pytest_httpbin.serve.Server object at 0x7f047633d490>
def test_compress_json(httpbin_both):
> r = http(
'--compress',
'--compress',
httpbin_both + '/post',
'foo=bar',
)
tests/test_compress.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
program_name = 'http', tolerate_error_exit_status = False
args = ['--compress', '--compress', 'http://127.0.0.1:46229/post', 'foo=bar']
kwargs = {'env': <MockEnvironment {'args': Namespace(method='POST', url='http://127.0.0.1:46229/post', request_items=[{'key': '...out': <tempfile._TemporaryFileWrapper object at 0x7f04764b4b90>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>}
env = <MockEnvironment {'args': Namespace(method='POST', url='http://127.0.0.1:46229/post', request_items=[{'key': 'foo', 'v...dout': <tempfile._TemporaryFileWrapper object at 0x7f04764b4b90>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>
stdout = <tempfile._TemporaryFileWrapper object at 0x7f04764b4b90>
devnull = <_io.TextIOWrapper name='/dev/null' mode='w+' encoding='UTF-8'>
args_with_config_defaults = ['--compress', '--compress', 'http://127.0.0.1:46229/post', 'foo=bar']
add_to_args = ['--traceback', '--timeout=3']
complete_args = ['http', '--traceback', '--timeout=3', '--compress', '--compress', 'http://127.0.0.1:46229/post', ...]
dump_stderr = <function http.<locals>.dump_stderr at 0x7f04761ca5c0>
exit_status = <ExitStatus.ERROR_TIMEOUT: 2>
def http(
*args,
program_name='http',
tolerate_error_exit_status=False,
**kwargs,
) -> Union[StrCLIResponse, BytesCLIResponse]:
# noinspection PyUnresolvedReferences
"""
Run HTTPie and capture stderr/out and exit status.
Content written to devnull will be captured only if
env.devnull is set manually.
Invoke `httpie.core.main()` with `args` and `kwargs`,
and return a `CLIResponse` subclass instance.
The return value is either a `StrCLIResponse`, or `BytesCLIResponse`
if unable to decode the output. Devnull is string when possible,
bytes otherwise.
The response has the following attributes:
`stdout` is represented by the instance itself (print r)
`stderr`: text written to stderr
`devnull` text written to devnull.
`exit_status`: the exit status
`json`: decoded JSON (if possible) or `None`
Exceptions are propagated.
If you pass ``tolerate_error_exit_status=True``, then error exit statuses
won't result into an exception.
Example:
$ http --auth=user:password GET pie.dev/basic-auth/user/password
>>> httpbin = getfixture('httpbin')
>>> r = http('-a', 'user:pw', httpbin.url + '/basic-auth/user/pw')
>>> type(r) == StrCLIResponse
True
>>> r.exit_status is ExitStatus.SUCCESS
True
>>> r.stderr
''
>>> 'HTTP/1.1 200 OK' in r
True
>>> r.json == {'authenticated': True, 'user': 'user'}
True
"""
env = kwargs.get('env')
if not env:
env = kwargs['env'] = MockEnvironment()
stdout = env.stdout
stderr = env.stderr
devnull = env.devnull
args = list(args)
args_with_config_defaults = args + env.config.default_options
add_to_args = []
if '--debug' not in args_with_config_defaults:
if (not tolerate_error_exit_status
and '--traceback' not in args_with_config_defaults):
add_to_args.append('--traceback')
if not any('--timeout' in arg for arg in args_with_config_defaults):
add_to_args.append('--timeout=3')
complete_args = [program_name, *add_to_args, *args]
# print(' '.join(complete_args))
def dump_stderr():
stderr.seek(0)
sys.stderr.write(stderr.read())
try:
try:
exit_status = core.main(args=complete_args, **kwargs)
if '--download' in args:
# Let the progress reporter thread finish.
time.sleep(.5)
except SystemExit:
if tolerate_error_exit_status:
exit_status = ExitStatus.ERROR
else:
dump_stderr()
raise
except Exception:
stderr.seek(0)
sys.stderr.write(stderr.read())
raise
else:
if (not tolerate_error_exit_status
and exit_status != ExitStatus.SUCCESS):
dump_stderr()
> raise ExitStatusError(
'httpie.core.main() unexpectedly returned'
f' a non-zero exit status: {exit_status}'
)
E tests.utils.ExitStatusError: httpie.core.main() unexpectedly returned a non-zero exit status: 2
tests/utils/__init__.py:421: ExitStatusError
----------------------------- Captured stderr call -----------------------------
http: error: Request timed out (3.0s).
___________________________ test_compress_form[http] ___________________________
httpbin_both = <pytest_httpbin.serve.Server object at 0x7f047633d490>
def test_compress_form(httpbin_both):
> r = http(
'--form',
'--compress',
'--compress',
httpbin_both + '/post',
'foo=bar',
)
tests/test_compress.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
program_name = 'http', tolerate_error_exit_status = False
args = ['--form', '--compress', '--compress', 'http://127.0.0.1:46229/post', 'foo=bar']
kwargs = {'env': <MockEnvironment {'args': Namespace(method='POST', url='http://127.0.0.1:46229/post', request_items=[{'key': '...out': <tempfile._TemporaryFileWrapper object at 0x7f0474de55d0>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>}
env = <MockEnvironment {'args': Namespace(method='POST', url='http://127.0.0.1:46229/post', request_items=[{'key': 'foo', 'v...dout': <tempfile._TemporaryFileWrapper object at 0x7f0474de55d0>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>
stdout = <tempfile._TemporaryFileWrapper object at 0x7f0474de55d0>
devnull = <_io.TextIOWrapper name='/dev/null' mode='w+' encoding='UTF-8'>
args_with_config_defaults = ['--form', '--compress', '--compress', 'http://127.0.0.1:46229/post', 'foo=bar']
add_to_args = ['--traceback', '--timeout=3']
complete_args = ['http', '--traceback', '--timeout=3', '--form', '--compress', '--compress', ...]
dump_stderr = <function http.<locals>.dump_stderr at 0x7f04761caf20>
exit_status = <ExitStatus.ERROR_TIMEOUT: 2>
def http(
*args,
program_name='http',
tolerate_error_exit_status=False,
**kwargs,
) -> Union[StrCLIResponse, BytesCLIResponse]:
# noinspection PyUnresolvedReferences
"""
Run HTTPie and capture stderr/out and exit status.
Content written to devnull will be captured only if
env.devnull is set manually.
Invoke `httpie.core.main()` with `args` and `kwargs`,
and return a `CLIResponse` subclass instance.
The return value is either a `StrCLIResponse`, or `BytesCLIResponse`
if unable to decode the output. Devnull is string when possible,
bytes otherwise.
The response has the following attributes:
`stdout` is represented by the instance itself (print r)
`stderr`: text written to stderr
`devnull` text written to devnull.
`exit_status`: the exit status
`json`: decoded JSON (if possible) or `None`
Exceptions are propagated.
If you pass ``tolerate_error_exit_status=True``, then error exit statuses
won't result into an exception.
Example:
$ http --auth=user:password GET pie.dev/basic-auth/user/password
>>> httpbin = getfixture('httpbin')
>>> r = http('-a', 'user:pw', httpbin.url + '/basic-auth/user/pw')
>>> type(r) == StrCLIResponse
True
>>> r.exit_status is ExitStatus.SUCCESS
True
>>> r.stderr
''
>>> 'HTTP/1.1 200 OK' in r
True
>>> r.json == {'authenticated': True, 'user': 'user'}
True
"""
env = kwargs.get('env')
if not env:
env = kwargs['env'] = MockEnvironment()
stdout = env.stdout
stderr = env.stderr
devnull = env.devnull
args = list(args)
args_with_config_defaults = args + env.config.default_options
add_to_args = []
if '--debug' not in args_with_config_defaults:
if (not tolerate_error_exit_status
and '--traceback' not in args_with_config_defaults):
add_to_args.append('--traceback')
if not any('--timeout' in arg for arg in args_with_config_defaults):
add_to_args.append('--timeout=3')
complete_args = [program_name, *add_to_args, *args]
# print(' '.join(complete_args))
def dump_stderr():
stderr.seek(0)
sys.stderr.write(stderr.read())
try:
try:
exit_status = core.main(args=complete_args, **kwargs)
if '--download' in args:
# Let the progress reporter thread finish.
time.sleep(.5)
except SystemExit:
if tolerate_error_exit_status:
exit_status = ExitStatus.ERROR
else:
dump_stderr()
raise
except Exception:
stderr.seek(0)
sys.stderr.write(stderr.read())
raise
else:
if (not tolerate_error_exit_status
and exit_status != ExitStatus.SUCCESS):
dump_stderr()
> raise ExitStatusError(
'httpie.core.main() unexpectedly returned'
f' a non-zero exit status: {exit_status}'
)
E tests.utils.ExitStatusError: httpie.core.main() unexpectedly returned a non-zero exit status: 2
tests/utils/__init__.py:421: ExitStatusError
----------------------------- Captured stderr call -----------------------------
http: error: Request timed out (3.0s).
___________________________ test_compress_raw[http] ____________________________
httpbin_both = <pytest_httpbin.serve.Server object at 0x7f047633d490>
def test_compress_raw(httpbin_both):
> r = http(
'--raw',
FILE_CONTENT,
'--compress',
'--compress',
httpbin_both + '/post',
)
tests/test_compress.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
program_name = 'http', tolerate_error_exit_status = False
args = ['--raw', '[one line of UTF8-encoded unicode text] χρυσαφὶ 太陽 เลิศ ♜♞♝♛♚♝♞♜ оживлённым तान्यहानि 有朋 ஸ்றீனிவாஸ ٱلرَّحْمـَبنِ', '--compress', '--compress', 'http://127.0.0.1:46229/post']
kwargs = {'env': <MockEnvironment {'args': Namespace(method='POST', url='http://127.0.0.1:46229/post', request_items=[], reques...out': <tempfile._TemporaryFileWrapper object at 0x7f047625ead0>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>}
env = <MockEnvironment {'args': Namespace(method='POST', url='http://127.0.0.1:46229/post', request_items=[], request_type=N...dout': <tempfile._TemporaryFileWrapper object at 0x7f047625ead0>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>
stdout = <tempfile._TemporaryFileWrapper object at 0x7f047625ead0>
devnull = <_io.TextIOWrapper name='/dev/null' mode='w+' encoding='UTF-8'>
args_with_config_defaults = ['--raw', '[one line of UTF8-encoded unicode text] χρυσαφὶ 太陽 เลิศ ♜♞♝♛♚♝♞♜ оживлённым तान्यहानि 有朋 ஸ்றீனிவாஸ ٱلرَّحْمـَبنِ', '--compress', '--compress', 'http://127.0.0.1:46229/post']
add_to_args = ['--traceback', '--timeout=3']
complete_args = ['http', '--traceback', '--timeout=3', '--raw', '[one line of UTF8-encoded unicode text] χρυσαφὶ 太陽 เลิศ ♜♞♝♛♚♝♞♜ оживлённым तान्यहानि 有朋 ஸ்றீனிவாஸ ٱلرَّحْمـَبنِ', '--compress', ...]
dump_stderr = <function http.<locals>.dump_stderr at 0x7f04761cbe20>
exit_status = <ExitStatus.ERROR_TIMEOUT: 2>
def http(
*args,
program_name='http',
tolerate_error_exit_status=False,
**kwargs,
) -> Union[StrCLIResponse, BytesCLIResponse]:
# noinspection PyUnresolvedReferences
"""
Run HTTPie and capture stderr/out and exit status.
Content written to devnull will be captured only if
env.devnull is set manually.
Invoke `httpie.core.main()` with `args` and `kwargs`,
and return a `CLIResponse` subclass instance.
The return value is either a `StrCLIResponse`, or `BytesCLIResponse`
if unable to decode the output. Devnull is string when possible,
bytes otherwise.
The response has the following attributes:
`stdout` is represented by the instance itself (print r)
`stderr`: text written to stderr
`devnull` text written to devnull.
`exit_status`: the exit status
`json`: decoded JSON (if possible) or `None`
Exceptions are propagated.
If you pass ``tolerate_error_exit_status=True``, then error exit statuses
won't result into an exception.
Example:
$ http --auth=user:password GET pie.dev/basic-auth/user/password
>>> httpbin = getfixture('httpbin')
>>> r = http('-a', 'user:pw', httpbin.url + '/basic-auth/user/pw')
>>> type(r) == StrCLIResponse
True
>>> r.exit_status is ExitStatus.SUCCESS
True
>>> r.stderr
''
>>> 'HTTP/1.1 200 OK' in r
True
>>> r.json == {'authenticated': True, 'user': 'user'}
True
"""
env = kwargs.get('env')
if not env:
env = kwargs['env'] = MockEnvironment()
stdout = env.stdout
stderr = env.stderr
devnull = env.devnull
args = list(args)
args_with_config_defaults = args + env.config.default_options
add_to_args = []
if '--debug' not in args_with_config_defaults:
if (not tolerate_error_exit_status
and '--traceback' not in args_with_config_defaults):
add_to_args.append('--traceback')
if not any('--timeout' in arg for arg in args_with_config_defaults):
add_to_args.append('--timeout=3')
complete_args = [program_name, *add_to_args, *args]
# print(' '.join(complete_args))
def dump_stderr():
stderr.seek(0)
sys.stderr.write(stderr.read())
try:
try:
exit_status = core.main(args=complete_args, **kwargs)
if '--download' in args:
# Let the progress reporter thread finish.
time.sleep(.5)
except SystemExit:
if tolerate_error_exit_status:
exit_status = ExitStatus.ERROR
else:
dump_stderr()
raise
except Exception:
stderr.seek(0)
sys.stderr.write(stderr.read())
raise
else:
if (not tolerate_error_exit_status
and exit_status != ExitStatus.SUCCESS):
dump_stderr()
> raise ExitStatusError(
'httpie.core.main() unexpectedly returned'
f' a non-zero exit status: {exit_status}'
)
E tests.utils.ExitStatusError: httpie.core.main() unexpectedly returned a non-zero exit status: 2
tests/utils/__init__.py:421: ExitStatusError
----------------------------- Captured stderr call -----------------------------
http: error: Request timed out (3.0s).
__________________________ test_compress_stdin[http] ___________________________
httpbin_both = <pytest_httpbin.serve.Server object at 0x7f047633d490>
def test_compress_stdin(httpbin_both):
env = MockEnvironment(
stdin=StdinBytesIO(FILE_PATH.read_bytes()),
stdin_isatty=False,
)
> r = http(
'--compress',
'--compress',
'PATCH',
httpbin_both + '/patch',
env=env,
)
tests/test_compress.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
program_name = 'http', tolerate_error_exit_status = False
args = ['--compress', '--compress', 'PATCH', 'http://127.0.0.1:46229/patch']
kwargs = {'env': <MockEnvironment {'args': Namespace(method='PATCH', url='http://127.0.0.1:46229/patch', request_items=[], requ...out': <tempfile._TemporaryFileWrapper object at 0x7f04764a3dd0>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>}
env = <MockEnvironment {'args': Namespace(method='PATCH', url='http://127.0.0.1:46229/patch', request_items=[], request_type...dout': <tempfile._TemporaryFileWrapper object at 0x7f04764a3dd0>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>
stdout = <tempfile._TemporaryFileWrapper object at 0x7f04764a3dd0>
devnull = <_io.TextIOWrapper name='/dev/null' mode='w+' encoding='UTF-8'>
args_with_config_defaults = ['--compress', '--compress', 'PATCH', 'http://127.0.0.1:46229/patch']
add_to_args = ['--traceback', '--timeout=3']
complete_args = ['http', '--traceback', '--timeout=3', '--compress', '--compress', 'PATCH', ...]
dump_stderr = <function http.<locals>.dump_stderr at 0x7f04761cb560>
exit_status = <ExitStatus.ERROR_TIMEOUT: 2>
def http(
*args,
program_name='http',
tolerate_error_exit_status=False,
**kwargs,
) -> Union[StrCLIResponse, BytesCLIResponse]:
# noinspection PyUnresolvedReferences
"""
Run HTTPie and capture stderr/out and exit status.
Content written to devnull will be captured only if
env.devnull is set manually.
Invoke `httpie.core.main()` with `args` and `kwargs`,
and return a `CLIResponse` subclass instance.
The return value is either a `StrCLIResponse`, or `BytesCLIResponse`
if unable to decode the output. Devnull is string when possible,
bytes otherwise.
The response has the following attributes:
`stdout` is represented by the instance itself (print r)
`stderr`: text written to stderr
`devnull` text written to devnull.
`exit_status`: the exit status
`json`: decoded JSON (if possible) or `None`
Exceptions are propagated.
If you pass ``tolerate_error_exit_status=True``, then error exit statuses
won't result into an exception.
Example:
$ http --auth=user:password GET pie.dev/basic-auth/user/password
>>> httpbin = getfixture('httpbin')
>>> r = http('-a', 'user:pw', httpbin.url + '/basic-auth/user/pw')
>>> type(r) == StrCLIResponse
True
>>> r.exit_status is ExitStatus.SUCCESS
True
>>> r.stderr
''
>>> 'HTTP/1.1 200 OK' in r
True
>>> r.json == {'authenticated': True, 'user': 'user'}
True
"""
env = kwargs.get('env')
if not env:
env = kwargs['env'] = MockEnvironment()
stdout = env.stdout
stderr = env.stderr
devnull = env.devnull
args = list(args)
args_with_config_defaults = args + env.config.default_options
add_to_args = []
if '--debug' not in args_with_config_defaults:
if (not tolerate_error_exit_status
and '--traceback' not in args_with_config_defaults):
add_to_args.append('--traceback')
if not any('--timeout' in arg for arg in args_with_config_defaults):
add_to_args.append('--timeout=3')
complete_args = [program_name, *add_to_args, *args]
# print(' '.join(complete_args))
def dump_stderr():
stderr.seek(0)
sys.stderr.write(stderr.read())
try:
try:
exit_status = core.main(args=complete_args, **kwargs)
if '--download' in args:
# Let the progress reporter thread finish.
time.sleep(.5)
except SystemExit:
if tolerate_error_exit_status:
exit_status = ExitStatus.ERROR
else:
dump_stderr()
raise
except Exception:
stderr.seek(0)
sys.stderr.write(stderr.read())
raise
else:
if (not tolerate_error_exit_status
and exit_status != ExitStatus.SUCCESS):
dump_stderr()
> raise ExitStatusError(
'httpie.core.main() unexpectedly returned'
f' a non-zero exit status: {exit_status}'
)
E tests.utils.ExitStatusError: httpie.core.main() unexpectedly returned a non-zero exit status: 2
tests/utils/__init__.py:421: ExitStatusError
----------------------------- Captured stderr call -----------------------------
http: error: Request timed out (3.0s).
___________________________ test_compress_file[http] ___________________________
httpbin_both = <pytest_httpbin.serve.Server object at 0x7f047633d490>
def test_compress_file(httpbin_both):
> r = http(
'--form',
'--compress',
'--compress',
'PUT',
httpbin_both + '/put',
f'file@{FILE_PATH}',
)
tests/test_compress.py:127:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
program_name = 'http', tolerate_error_exit_status = False
args = ['--form', '--compress', '--compress', 'PUT', 'http://127.0.0.1:46229/put', 'file@/build/httpie/src/cli-3.2.2/tests/fixtures/test.txt']
kwargs = {'env': <MockEnvironment {'args': Namespace(method='PUT', url='http://127.0.0.1:46229/put', request_items=[{'key': 'fi...out': <tempfile._TemporaryFileWrapper object at 0x7f047625c450>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>}
env = <MockEnvironment {'args': Namespace(method='PUT', url='http://127.0.0.1:46229/put', request_items=[{'key': 'file', 'va...dout': <tempfile._TemporaryFileWrapper object at 0x7f047625c450>,
'stdout_encoding': 'utf-8',
'stdout_isatty': True}>
stdout = <tempfile._TemporaryFileWrapper object at 0x7f047625c450>
devnull = <_io.TextIOWrapper name='/dev/null' mode='w+' encoding='UTF-8'>
args_with_config_defaults = ['--form', '--compress', '--compress', 'PUT', 'http://127.0.0.1:46229/put', 'file@/build/httpie/src/cli-3.2.2/tests/fixtures/test.txt']
add_to_args = ['--traceback', '--timeout=3']
complete_args = ['http', '--traceback', '--timeout=3', '--form', '--compress', '--compress', ...]
dump_stderr = <function http.<locals>.dump_stderr at 0x7f04761f8b80>
exit_status = <ExitStatus.ERROR_TIMEOUT: 2>
def http(
*args,
program_name='http',
tolerate_error_exit_status=False,
**kwargs,
) -> Union[StrCLIResponse, BytesCLIResponse]:
# noinspection PyUnresolvedReferences
"""
Run HTTPie and capture stderr/out and exit status.
Content written to devnull will be captured only if
env.devnull is set manually.
Invoke `httpie.core.main()` with `args` and `kwargs`,
and return a `CLIResponse` subclass instance.
The return value is either a `StrCLIResponse`, or `BytesCLIResponse`
if unable to decode the output. Devnull is string when possible,
bytes otherwise.
The response has the following attributes:
`stdout` is represented by the instance itself (print r)
`stderr`: text written to stderr
`devnull` text written to devnull.
`exit_status`: the exit status
`json`: decoded JSON (if possible) or `None`
Exceptions are propagated.
If you pass ``tolerate_error_exit_status=True``, then error exit statuses
won't result into an exception.
Example:
$ http --auth=user:password GET pie.dev/basic-auth/user/password
>>> httpbin = getfixture('httpbin')
>>> r = http('-a', 'user:pw', httpbin.url + '/basic-auth/user/pw')
>>> type(r) == StrCLIResponse
True
>>> r.exit_status is ExitStatus.SUCCESS
True
>>> r.stderr
''
>>> 'HTTP/1.1 200 OK' in r
True
>>> r.json == {'authenticated': True, 'user': 'user'}
True
"""
env = kwargs.get('env')
if not env:
env = kwargs['env'] = MockEnvironment()
stdout = env.stdout
stderr = env.stderr
devnull = env.devnull
args = list(args)
args_with_config_defaults = args + env.config.default_options
add_to_args = []
if '--debug' not in args_with_config_defaults:
if (not tolerate_error_exit_status
and '--traceback' not in args_with_config_defaults):
add_to_args.append('--traceback')
if not any('--timeout' in arg for arg in args_with_config_defaults):
add_to_args.append('--timeout=3')
complete_args = [program_name, *add_to_args, *args]
# print(' '.join(complete_args))
def dump_stderr():
stderr.seek(0)
sys.stderr.write(stderr.read())
try:
try:
exit_status = core.main(args=complete_args, **kwargs)
if '--download' in args:
# Let the progress reporter thread finish.
time.sleep(.5)
except SystemExit:
if tolerate_error_exit_status:
exit_status = ExitStatus.ERROR
else:
dump_stderr()
raise
except Exception:
stderr.seek(0)
sys.stderr.write(stderr.read())
raise
else:
if (not tolerate_error_exit_status
and exit_status != ExitStatus.SUCCESS):
dump_stderr()
> raise ExitStatusError(
'httpie.core.main() unexpectedly returned'
f' a non-zero exit status: {exit_status}'
)
E tests.utils.ExitStatusError: httpie.core.main() unexpectedly returned a non-zero exit status: 2
tests/utils/__init__.py:421: ExitStatusError
----------------------------- Captured stderr call -----------------------------
http: error: Request timed out (3.0s).
________________ test_compress_force_with_negative_ratio[https] ________________
httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f047633d890>
def test_compress_force_with_negative_ratio(httpbin_both):
r = http(
'--compress',
'--compress',
httpbin_both + '/post',
'foo=bar',
)
> assert HTTP_OK in r
E AssertionError: assert '200 OK' in 'HTTP/1.1 400 BAD REQUEST\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Origin: *\r\nConnection: C...itle>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n\n\n'
tests/test_compress.py:63: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [10/Sep/2023 19:42:52] "POST /post HTTP/1.1" 400 167
__________________________ test_compress_json[https] ___________________________
httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f047633d890>
def test_compress_json(httpbin_both):
r = http(
'--compress',
'--compress',
httpbin_both + '/post',
'foo=bar',
)
> assert HTTP_OK in r
E AssertionError: assert '200 OK' in 'HTTP/1.1 400 BAD REQUEST\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Origin: *\r\nConnection: C...itle>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n\n\n'
tests/test_compress.py:75: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [10/Sep/2023 19:42:53] "POST /post HTTP/1.1" 400 167
__________________________ test_compress_form[https] ___________________________
httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f047633d890>
def test_compress_form(httpbin_both):
r = http(
'--form',
'--compress',
'--compress',
httpbin_both + '/post',
'foo=bar',
)
> assert HTTP_OK in r
E AssertionError: assert '200 OK' in 'HTTP/1.1 400 BAD REQUEST\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Origin: *\r\nConnection: C...itle>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n\n\n'
tests/test_compress.py:89: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [10/Sep/2023 19:42:54] "POST /post HTTP/1.1" 400 167
___________________________ test_compress_raw[https] ___________________________
httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f047633d890>
def test_compress_raw(httpbin_both):
r = http(
'--raw',
FILE_CONTENT,
'--compress',
'--compress',
httpbin_both + '/post',
)
> assert HTTP_OK in r
E AssertionError: assert '200 OK' in 'HTTP/1.1 400 BAD REQUEST\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Origin: *\r\nConnection: C...itle>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n\n\n'
tests/test_compress.py:103: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [10/Sep/2023 19:42:55] "POST /post HTTP/1.1" 400 167
__________________________ test_compress_stdin[https] __________________________
httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f047633d890>
def test_compress_stdin(httpbin_both):
env = MockEnvironment(
stdin=StdinBytesIO(FILE_PATH.read_bytes()),
stdin_isatty=False,
)
r = http(
'--compress',
'--compress',
'PATCH',
httpbin_both + '/patch',
env=env,
)
> assert HTTP_OK in r
E AssertionError: assert '200 OK' in 'HTTP/1.1 400 BAD REQUEST\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Origin: *\r\nConnection: C...itle>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n\n\n'
tests/test_compress.py:120: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [10/Sep/2023 19:42:56] "PATCH /patch HTTP/1.1" 400 167
__________________________ test_compress_file[https] ___________________________
httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f047633d890>
def test_compress_file(httpbin_both):
r = http(
'--form',
'--compress',
'--compress',
'PUT',
httpbin_both + '/put',
f'file@{FILE_PATH}',
)
> assert HTTP_OK in r
E AssertionError: assert '200 OK' in 'HTTP/1.1 400 BAD REQUEST\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Origin: *\r\nConnection: C...itle>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n\n\n'
tests/test_compress.py:135: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [10/Sep/2023 19:42:57] "PUT /put HTTP/1.1" 400 167
_________ TestBinaryResponseData.test_binary_suppresses_when_terminal __________
self = <tests.test_binary.TestBinaryResponseData object at 0x7f04768b4410>
httpbin = <pytest_httpbin.serve.Server object at 0x7f047633d490>
def test_binary_suppresses_when_terminal(self, httpbin):
r = http('GET', httpbin + '/bytes/1024?seed=1')
> assert BINARY_SUPPRESSED_NOTICE.decode() in r
E AssertionError: assert '\n+-----------------------------------------+\n| NOTE: binary data not shown in terminal |\n+-----------------------------------------+' in 'HTTP/1.1 500 Internal Server Error\r\nConnection: Close\r\nContent-Length: 59\r\nContent-Type: text/plain\r\nDate: Su...23 18:43:01 GMT\r\nServer: Pytest-HTTPBIN/0.1.0\r\n\r\nA server error occurred. Please contact the administrator.\n\n'
E + where '\n+-----------------------------------------+\n| NOTE: binary data not shown in terminal |\n+-----------------------------------------+' = <built-in method decode of bytes object at 0x7f0476cce1e0>()
E + where <built-in method decode of bytes object at 0x7f0476cce1e0> = b'\n+-----------------------------------------+\n| NOTE: binary data not shown in terminal |\n+-----------------------------------------+'.decode
tests/test_binary.py:38: AssertionError
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
File "/usr/lib/python3.11/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/lib/python3.11/wsgiref/handlers.py", line 184, in finish_response
self.write(data)
File "/usr/lib/python3.11/wsgiref/handlers.py", line 278, in write
assert type(data) is bytes, \
^^^^^^^^^^^^^^^^^^^
AssertionError: write() argument must be a bytes instance
127.0.0.1 - - [10/Sep/2023 19:43:01] "GET /bytes/1024?seed=1 HTTP/1.1" 500 59
__ TestBinaryResponseData.test_binary_suppresses_when_not_terminal_but_pretty __
self = <tests.test_binary.TestBinaryResponseData object at 0x7f04768e9f10>
httpbin = <pytest_httpbin.serve.Server object at 0x7f047633d490>
def test_binary_suppresses_when_not_terminal_but_pretty(self, httpbin):
env = MockEnvironment(stdin_isatty=True, stdout_isatty=False)
r = http('--pretty=all', 'GET', httpbin + '/bytes/1024?seed=1', env=env)
> assert BINARY_SUPPRESSED_NOTICE.decode() in r
E AssertionError: assert '\n+-----------------------------------------+\n| NOTE: binary data not shown in terminal |\n+-----------------------------------------+' in 'A server error occurred. Please contact the administrator.'
E + where '\n+-----------------------------------------+\n| NOTE: binary data not shown in terminal |\n+-----------------------------------------+' = <built-in method decode of bytes object at 0x7f0476cce1e0>()
E + where <built-in method decode of bytes object at 0x7f0476cce1e0> = b'\n+-----------------------------------------+\n| NOTE: binary data not shown in terminal |\n+-----------------------------------------+'.decode
tests/test_binary.py:43: AssertionError
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
File "/usr/lib/python3.11/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/lib/python3.11/wsgiref/handlers.py", line 184, in finish_response
self.write(data)
File "/usr/lib/python3.11/wsgiref/handlers.py", line 278, in write
assert type(data) is bytes, \
^^^^^^^^^^^^^^^^^^^
AssertionError: write() argument must be a bytes instance
127.0.0.1 - - [10/Sep/2023 19:43:01] "GET /bytes/1024?seed=1 HTTP/1.1" 500 59
____ TestBinaryResponseData.test_binary_included_and_correct_when_suitable _____
self = <tests.test_binary.TestBinaryResponseData object at 0x7f04768ebbd0>
httpbin = <pytest_httpbin.serve.Server object at 0x7f047633d490>
def test_binary_included_and_correct_when_suitable(self, httpbin):
env = MockEnvironment(stdin_isatty=True, stdout_isatty=False)
url = httpbin + '/bytes/1024?seed=1'
r = http('GET', url, env=env)
expected = requests.get(url).content
> assert r == expected
E AssertionError: assert 'A server error occurred. Please contact the administrator.' == b'A server error occurred. Please contact the administrator.'
tests/test_binary.py:50: AssertionError
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
File "/usr/lib/python3.11/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/lib/python3.11/wsgiref/handlers.py", line 184, in finish_response
self.write(data)
File "/usr/lib/python3.11/wsgiref/handlers.py", line 278, in write
assert type(data) is bytes, \
^^^^^^^^^^^^^^^^^^^
AssertionError: write() argument must be a bytes instance
127.0.0.1 - - [10/Sep/2023 19:43:01] "GET /bytes/1024?seed=1 HTTP/1.1" 500 59
Traceback (most recent call last):
File "/usr/lib/python3.11/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/lib/python3.11/wsgiref/handlers.py", line 184, in finish_response
self.write(data)
File "/usr/lib/python3.11/wsgiref/handlers.py", line 278, in write
assert type(data) is bytes, \
^^^^^^^^^^^^^^^^^^^
AssertionError: write() argument must be a bytes instance
127.0.0.1 - - [10/Sep/2023 19:43:01] "GET /bytes/1024?seed=1 HTTP/1.1" 500 59
=============================== warnings summary ===============================
tests/test_auth.py::test_digest_auth[http---auth-type]
tests/test_auth.py::test_digest_auth[http--A]
tests/test_auth.py::test_digest_auth[https---auth-type]
tests/test_auth.py::test_digest_auth[https--A]
tests/test_auth.py::test_auth_plugin_netrc_parse[digest-/digest-auth/auth/httpie/password]
tests/test_encoding.py::test_unicode_digest_auth
/usr/lib/python3.11/site-packages/werkzeug/datastructures/auth.py:297: UserWarning: The 'set_digest' method is deprecated and will be removed in Werkzeug 3.0. Create and assign an instance instead.
warnings.warn(
tests/test_auth.py::test_digest_auth[http---auth-type]
tests/test_auth.py::test_digest_auth[http--A]
tests/test_auth.py::test_digest_auth[https---auth-type]
tests/test_auth.py::test_digest_auth[https--A]
tests/test_auth.py::test_auth_plugin_netrc_parse[digest-/digest-auth/auth/httpie/password]
tests/test_encoding.py::test_unicode_digest_auth
/usr/lib/python3.11/site-packages/httpbin/core.py:1148: DeprecationWarning: 'parse_authorization_header' is deprecated and will be removed in Werkzeug 2.4. Use 'Authorization.from_header' instead.
credentials = parse_authorization_header(authorization)
tests/test_auth.py::test_digest_auth[http---auth-type]
tests/test_auth.py::test_digest_auth[http--A]
tests/test_auth.py::test_digest_auth[https---auth-type]
tests/test_auth.py::test_digest_auth[https--A]
tests/test_auth.py::test_auth_plugin_netrc_parse[digest-/digest-auth/auth/httpie/password]
tests/test_encoding.py::test_unicode_digest_auth
/usr/lib/python3.11/site-packages/httpbin/helpers.py:359: DeprecationWarning: 'parse_authorization_header' is deprecated and will be removed in Werkzeug 2.4. Use 'Authorization.from_header' instead.
credentials = parse_authorization_header(request.headers.get('Authorization'))
tests/test_httpie.py::test_headers[http]
tests/test_downloads.py::TestDownloads::test_actual_download[https]
tests/test_httpie.py::test_raw_POST_key_values_supplied
tests/test_offline.py::test_offline_chunked
tests/test_uploads.py::TestMultipartFormDataFileUpload::test_multipart_preserve_order
tests/test_uploads.py::TestRequestBodyFromFilePath::test_request_body_from_file_by_path
tests/test_uploads.py::TestRequestBodyFromFilePath::test_request_body_from_file_by_path_no_data_items_allowed
tests/test_uploads.py::TestRequestBodyFromFilePath::test_multiple_request_bodies_from_file_by_path
tests/test_windows.py::TestFakeWindows::test_output_file_pretty_not_allowed_on_windows
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:159: ResourceWarning: unclosed file <_io.BufferedReader name='/build/httpie/src/cli-3.2.2/tests/fixtures/test.txt'>
self.args, no_options = super().parse_known_args(args, namespace)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_httpie.py::test_headers_unset[http]
<frozen _collections_abc>:774: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/httpie_stderrv5llcbih' mode='w+t' encoding='utf-8'>
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_httpie.py::test_headers[https]
/usr/lib/python3.11/socket.py:335: ResourceWarning: unclosed file <_io.FileIO name='/build/httpie/src/cli-3.2.2/tests/fixtures/test.txt' mode='rb' closefd=True>
buffer = io.BufferedReader(raw, buffering)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_auth.py::test_password_prompt
/usr/lib/python3.11/collections/__init__.py:453: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/httpie_stderr3jziyitc' mode='w+t' encoding='utf-8'>
result = self._make(_map(kwds.pop, field_names, self))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_binary.py::TestBinaryResponseData::test_binary_suppresses_when_terminal
/usr/lib/python3.11/ast.py:50: ResourceWarning: unclosed file <_io.FileIO name='/build/httpie/src/cli-3.2.2/tests/fixtures/test.bin' mode='rb' closefd=True>
return compile(source, filename, mode, flags,
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_compress.py::test_cannot_combine_compress_with_chunked
/usr/lib/python3.11/collections/__init__.py:453: ResourceWarning: unclosed file <_io.BufferedReader name='/build/httpie/src/cli-3.2.2/tests/fixtures/test.bin'>
result = self._make(_map(kwds.pop, field_names, self))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie.py::TestIntegration::test_cookie_parser
/build/httpie/src/cli-3.2.2/tests/test_cookie.py:19: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
self.mock_server_thread.setDaemon(True)
tests/test_cookie_on_redirects.py: 12 warnings
tests/test_redirects.py: 4 warnings
/usr/lib/python3.11/site-packages/werkzeug/datastructures/headers.py:330: DeprecationWarning: Passing bytes as a header value is deprecated and will not be supported in Werkzeug 3.0.
_value = _str_header_value(_value)
tests/test_cookie_on_redirects.py::test_explicit_user_set_cookie[remote_httpbin]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 54942), raddr=('172.67.185.65', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_explicit_user_set_cookie_in_session[remote_httpbin]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 34010), raddr=('104.21.19.53', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_saved_user_set_cookie_in_session[remote_httpbin]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 54958), raddr=('172.67.185.65', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_explicit_user_set_headers[True-remote_httpbin]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 34024), raddr=('104.21.19.53', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_explicit_user_set_headers[False-remote_httpbin]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 54962), raddr=('172.67.185.65', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_server_set_cookie_on_redirect_different_domain[True]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 36899)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_server_set_cookie_on_redirect_different_domain[False]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 39141)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_saved_session_cookies_on_different_domain
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 53206), raddr=('104.21.19.53', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_saved_session_cookies_on_redirect[httpbin-remote_httpbin-remote_httpbin-False]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 33636), raddr=('172.67.185.65', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_saved_session_cookies_on_redirect[httpbin-httpbin-remote_httpbin-False]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 53216), raddr=('104.21.19.53', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_saved_session_cookies_on_redirect[httpbin-remote_httpbin-httpbin-True]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 33642), raddr=('172.67.185.65', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_saved_session_cookie_pool
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 53222), raddr=('104.21.19.53', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_saved_session_cookie_pool
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 33648), raddr=('172.67.185.65', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_cookie_on_redirects.py::test_saved_session_cookie_pool
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=6, laddr=('192.168.0.5', 53234), raddr=('104.21.19.53', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_downloads.py::TestDownloads::test_download_with_redirect_original_url_used_for_filename
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed file <_io.FileIO name='1.json' mode='ab+' closefd=True>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_encoding.py: 12 warnings
tests/test_stream.py: 8 warnings
/usr/lib/python3.11/site-packages/responses/__init__.py:555: DeprecationWarning: stream argument is deprecated. Use stream parameter in request directly
warn(
tests/test_httpie.py::test_response_headers_multiple
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=29, family=2, type=1, proto=6, laddr=('127.0.0.1', 36862), raddr=('127.0.0.1', 39465)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_httpie.py::test_response_headers_multiple
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 39465)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_httpie.py::test_response_headers_multiple_repeated
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=29, family=2, type=1, proto=6, laddr=('127.0.0.1', 55442), raddr=('127.0.0.1', 33001)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_httpie.py::test_response_headers_multiple_repeated
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 33001)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_httpie.py::test_response_headers_multiple_representation[format]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=29, family=2, type=1, proto=6, laddr=('127.0.0.1', 36888), raddr=('127.0.0.1', 34363)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_httpie.py::test_response_headers_multiple_representation[format]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 34363)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_httpie.py::test_response_headers_multiple_representation[none]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=29, family=2, type=1, proto=6, laddr=('127.0.0.1', 34584), raddr=('127.0.0.1', 42969)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_httpie.py::test_response_headers_multiple_representation[none]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 42969)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_httpie_cli.py::test_httpie_sessions_upgrade[extra_args1-extra_variables1-old_session_file3-new_session_file3]
tests/test_regressions.py::test_Host_header_overwrite
tests/test_ssl.py::test_ssl_version[tls1.1]
/usr/lib/python3.11/collections/__init__.py:444: ResourceWarning: unclosed file <_io.BufferedReader name='/build/httpie/src/cli-3.2.2/tests/fixtures/test.txt'>
result = tuple_new(cls, iterable)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_json.py::test_duplicate_keys_support_from_input_file
tests/test_json.py::test_simple_json_arguments_with_non_json[1]
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:159: ResourceWarning: unclosed file <_io.BufferedReader name='/build/httpie/src/cli-3.2.2/tests/fixtures/test_with_dupe_keys.json'>
self.args, no_options = super().parse_known_args(args, namespace)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet[quiet_flags1]
tests/test_output.py::TestQuietFlag::test_quiet_with_check_status_non_zero_pipe
tests/test_output.py::TestQuietFlag::test_quiet_with_password_prompt[quiet_flags1]
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:157: ResourceWarning: unclosed file <_io.TextIOWrapper name=28 mode='w+t' encoding='utf-8'>
self.env = env
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet[quiet_flags2]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-h-quiet_flags3]
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:157: ResourceWarning: unclosed file <_io.TextIOWrapper name=30 mode='w+t' encoding='utf-8'>
self.env = env
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet[quiet_flags3]
tests/test_output.py::TestQuietFlag::test_quiet_quiet_with_check_status_non_zero
tests/test_output.py::TestQuietFlag::test_double_quiet_on_error
tests/test_output.py::TestQuietFlag::test_quiet_with_password_prompt[quiet_flags2]
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:157: ResourceWarning: unclosed file <_io.TextIOWrapper name=31 mode='w+t' encoding='utf-8'>
self.env = env
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_check_status_non_zero
tests/test_output.py::TestQuietFlag::test_quiet_quiet_with_check_status_non_zero_pipe
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-b-quiet_flags0]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-v-quiet_flags0]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-v-quiet_flags3]
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:157: ResourceWarning: unclosed file <_io.TextIOWrapper name=32 mode='w+t' encoding='utf-8'>
self.env = env
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_on_python_warnings[flags0-1]
tests/test_output.py::TestQuietFlag::test_quiet_on_python_warnings[flags1-1]
tests/test_output.py::TestQuietFlag::test_quiet_on_python_warnings[flags2-0]
/usr/lib/python3.11/unittest/mock.py:1375: PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.
return func(*newargs, **newkeywargs)
tests/test_output.py::TestQuietFlag::test_double_quiet_on_error
/usr/lib/python3.11/collections/__init__.py:453: ResourceWarning: unclosed file <_io.FileIO name='/tmp/httpie_stderr69i6aw4p' mode='rb+' closefd=True>
result = self._make(_map(kwds.pop, field_names, self))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_double_quiet_on_error
/usr/lib/python3.11/collections/__init__.py:453: ResourceWarning: unclosed file <_io.FileIO name=28 mode='rb+' closefd=True>
result = self._make(_map(kwds.pop, field_names, self))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_double_quiet_on_error
/usr/lib/python3.11/collections/__init__.py:453: ResourceWarning: unclosed file <_io.FileIO name='/tmp/httpie_stderrfh8sqxh4' mode='rb+' closefd=True>
result = self._make(_map(kwds.pop, field_names, self))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_password_prompt[quiet_flags0]
tests/test_output.py::TestQuietFlag::test_quiet_with_password_prompt[quiet_flags3]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-b-quiet_flags1]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-v-quiet_flags1]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-p=hH-quiet_flags0]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-p=hH-quiet_flags3]
tests/test_output.py::TestQuietFlag::test_quiet_with_output_redirection[False-quiet_flags0]
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:157: ResourceWarning: unclosed file <_io.TextIOWrapper name=33 mode='w+t' encoding='utf-8'>
self.env = env
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_password_prompt[quiet_flags3]
/usr/lib/python3.11/collections/__init__.py:453: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/httpie_stderr1g2fhwmt' mode='w+t' encoding='utf-8'>
result = self._make(_map(kwds.pop, field_names, self))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_password_prompt[quiet_flags3]
/usr/lib/python3.11/collections/__init__.py:453: ResourceWarning: unclosed file <_io.FileIO name='/tmp/httpie_stderri7bi650h' mode='rb+' closefd=True>
result = self._make(_map(kwds.pop, field_names, self))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_password_prompt[quiet_flags3]
/usr/lib/python3.11/collections/__init__.py:453: ResourceWarning: unclosed file <_io.FileIO name='/tmp/httpie_stderretvnn273' mode='rb+' closefd=True>
result = self._make(_map(kwds.pop, field_names, self))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_password_prompt[quiet_flags3]
/usr/lib/python3.11/collections/__init__.py:453: ResourceWarning: unclosed file <_io.FileIO name='/tmp/httpie_stderri4gu4z7o' mode='rb+' closefd=True>
result = self._make(_map(kwds.pop, field_names, self))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-h-quiet_flags0]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-p=hH-quiet_flags1]
tests/test_output.py::TestQuietFlag::test_quiet_with_output_redirection[True-quiet_flags0]
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:157: ResourceWarning: unclosed file <_io.TextIOWrapper name=34 mode='w+t' encoding='utf-8'>
self.env = env
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-h-quiet_flags1]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-b-quiet_flags2]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-v-quiet_flags2]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-p=hH-quiet_flags2]
tests/test_output.py::TestQuietFlag::test_quiet_with_output_redirection[True-quiet_flags3]
tests/test_output.py::TestQuietFlag::test_quiet_with_output_redirection[False-quiet_flags3]
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:157: ResourceWarning: unclosed file <_io.TextIOWrapper name=16 mode='w+t' encoding='utf-8'>
self.env = env
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-h-quiet_flags2]
tests/test_output.py::TestQuietFlag::test_quiet_with_explicit_output_options[-b-quiet_flags3]
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:157: ResourceWarning: unclosed file <_io.TextIOWrapper name=29 mode='w+t' encoding='utf-8'>
self.env = env
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_output_redirection[True-quiet_flags1]
tests/test_output.py::TestQuietFlag::test_quiet_with_output_redirection[False-quiet_flags1]
tests/test_output.py::TestVerboseFlag::test_verbose
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:157: ResourceWarning: unclosed file <_io.TextIOWrapper name=35 mode='w+t' encoding='utf-8'>
self.env = env
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestQuietFlag::test_quiet_with_output_redirection[True-quiet_flags2]
tests/test_output.py::TestQuietFlag::test_quiet_with_output_redirection[False-quiet_flags2]
/build/httpie/src/cli-3.2.2/httpie/cli/argparser.py:157: ResourceWarning: unclosed file <_io.TextIOWrapper name=36 mode='w+t' encoding='utf-8'>
self.env = env
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestVerboseFlag::test_verbose_raw
/usr/lib/python3.11/site-packages/httpbin/helpers.py:181: ResourceWarning: unclosed file <_io.FileIO name='/tmp/httpie_stderrjxu_ayqx' mode='rb+' closefd=True>
_json = json.loads(data.decode('utf-8'))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::TestVerboseFlag::test_verbose_raw
/usr/lib/python3.11/site-packages/httpbin/helpers.py:181: ResourceWarning: unclosed file <_io.FileIO name='/tmp/httpie_stderr2i5g37az' mode='rb+' closefd=True>
_json = json.loads(data.decode('utf-8'))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[-auto]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 42157)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[-pie]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 44741)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[-pie-dark]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 39327)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[-pie-light]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 34355)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[-solarized]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 36387)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ -auto]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 41919)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ -pie]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 35741)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ -pie-dark]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 37557)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ -pie-light]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 33265)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ -solarized]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 36545)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ OK-auto]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 38739)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ OK-pie]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 42753)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ OK-pie-dark]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 39687)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ OK-pie-light]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 36817)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ OK-solarized]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 44763)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ OK -auto]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 43085)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ OK -pie]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 45241)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ OK -pie-dark]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 44121)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ OK -pie-light]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 40687)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ OK -solarized]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 43339)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ CUSTOM -auto]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 45481)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ CUSTOM -pie]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 42245)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ CUSTOM -pie-dark]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 44959)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ CUSTOM -pie-light]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 38431)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_output.py::test_ensure_status_code_is_shown_on_all_themes[ CUSTOM -solarized]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 41031)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_regressions.py::test_Host_header_overwrite
tests/test_regressions.py::test_Host_header_overwrite
tests/test_uploads.py::TestMultipartFormDataFileUpload::test_multipart
/usr/lib/python3.11/collections/__init__.py:444: ResourceWarning: unclosed file <_io.FileIO name='/build/httpie/src/cli-3.2.2/tests/fixtures/test.txt' mode='rb' closefd=True>
result = tuple_new(cls, iterable)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_sessions.py::TestSession::test_session_with_cookie_followed_by_another_header
/usr/lib/python3.11/json/encoder.py:258: ResourceWarning: unclosed file <_io.BufferedReader name='/build/httpie/src/cli-3.2.2/tests/fixtures/test.txt'>
return _iterencode(o, 0)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_sessions.py::TestSession::test_download_in_session
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed file <_io.FileIO name='get.json' mode='ab+' closefd=True>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_sessions.py::test_secure_cookies_on_localhost[localhost_http_server-expected_cookies0]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=28, family=2, type=1, proto=0, laddr=('127.0.0.1', 45945)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_sessions.py::test_secure_cookies_on_localhost[remote_httpbin-expected_cookies1]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=32, family=2, type=1, proto=6, laddr=('192.168.0.5', 55374), raddr=('172.67.185.65', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_sessions.py::test_secure_cookies_on_localhost[remote_httpbin-expected_cookies1]
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=32, family=2, type=1, proto=6, laddr=('192.168.0.5', 54218), raddr=('104.21.19.53', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_ssl.py::test_ssl_version[tls1]
/usr/lib/python3.11/site-packages/urllib3/util/ssl_.py:290: DeprecationWarning: ssl.PROTOCOL_TLSv1 is deprecated
context = SSLContext(ssl_version)
tests/test_ssl.py::test_ssl_version[tls1.1]
/usr/lib/python3.11/site-packages/urllib3/util/ssl_.py:290: DeprecationWarning: ssl.PROTOCOL_TLSv1_1 is deprecated
context = SSLContext(ssl_version)
tests/test_ssl.py::test_ssl_version[tls1.2]
/usr/lib/python3.11/site-packages/urllib3/util/ssl_.py:290: DeprecationWarning: ssl.PROTOCOL_TLSv1_2 is deprecated
context = SSLContext(ssl_version)
tests/test_ssl.py::TestServerCert::test_verify_no_OK
tests/test_ssl.py::TestServerCert::test_verify_false_OK[false]
tests/test_ssl.py::TestServerCert::test_verify_false_OK[fALse]
/usr/lib/python3.11/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
warnings.warn(
tests/test_stream.py::test_auto_streaming[extras0-3]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 46527)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_stream.py::test_auto_streaming[extras1-3]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 46647)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_stream.py::test_auto_streaming[extras2-1]
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 36891)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_stream.py::test_streaming_encoding_detection
/usr/lib/python3.11/site-packages/_pytest/fixtures.py:911: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=0, laddr=('127.0.0.1', 41435)>
next(it)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_tokens.py::test_verbose_chunked
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=29, family=2, type=1, proto=6, laddr=('192.168.0.5', 54234), raddr=('104.21.19.53', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_uploads.py::test_chunked_form
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=29, family=2, type=1, proto=6, laddr=('192.168.0.5', 54248), raddr=('104.21.19.53', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_uploads.py::test_chunked_raw
/build/httpie/src/cli-3.2.2/httpie/core.py:100: ResourceWarning: unclosed <socket.socket fd=29, family=2, type=1, proto=6, laddr=('192.168.0.5', 55408), raddr=('172.67.185.65', 80)>
exit_status = main_program(
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_uploads.py::TestMultipartFormDataFileUpload::test_upload_multiple_fields_with_the_same_name
/usr/lib/python3.11/http/client.py:1258: ResourceWarning: unclosed file <_io.FileIO name='/build/httpie/src/cli-3.2.2/tests/fixtures/test.txt' mode='rb' closefd=True>
if hasattr(one_value, 'encode'):
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_uploads.py::TestRequestBodyFromFilePath::test_request_body_from_file_by_path_with_explicit_content_type
tests/test_uploads.py::TestRequestBodyFromFilePath::test_request_body_from_file_by_path_with_explicit_content_type
/usr/lib/python3.11/http/server.py:303: ResourceWarning: unclosed file <_io.FileIO name='/build/httpie/src/cli-3.2.2/tests/fixtures/test.txt' mode='rb' closefd=True>
if any(not component.isdigit() for component in version_number):
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/test_windows.py::TestFakeWindows::test_output_file_pretty_not_allowed_on_windows
tests/test_windows.py::TestFakeWindows::test_output_file_pretty_not_allowed_on_windows
/usr/lib/python3.11/collections/__init__.py:453: ResourceWarning: unclosed file <_io.BufferedReader name='/build/httpie/src/cli-3.2.2/tests/fixtures/test.txt'>
result = self._make(_map(kwds.pop, field_names, self))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_compress.py::test_compress_force_with_negative_ratio[http]
FAILED tests/test_compress.py::test_compress_json[http] - tests.utils.ExitSta...
FAILED tests/test_compress.py::test_compress_form[http] - tests.utils.ExitSta...
FAILED tests/test_compress.py::test_compress_raw[http] - tests.utils.ExitStat...
FAILED tests/test_compress.py::test_compress_stdin[http] - tests.utils.ExitSt...
FAILED tests/test_compress.py::test_compress_file[http] - tests.utils.ExitSta...
FAILED tests/test_compress.py::test_compress_force_with_negative_ratio[https]
FAILED tests/test_compress.py::test_compress_json[https] - AssertionError: as...
FAILED tests/test_compress.py::test_compress_form[https] - AssertionError: as...
FAILED tests/test_compress.py::test_compress_raw[https] - AssertionError: ass...
FAILED tests/test_compress.py::test_compress_stdin[https] - AssertionError: a...
FAILED tests/test_compress.py::test_compress_file[https] - AssertionError: as...
FAILED tests/test_binary.py::TestBinaryResponseData::test_binary_suppresses_when_terminal
FAILED tests/test_binary.py::TestBinaryResponseData::test_binary_suppresses_when_not_terminal_but_pretty
FAILED tests/test_binary.py::TestBinaryResponseData::test_binary_included_and_correct_when_suitable
= 15 failed, 975 passed, 4 skipped, 28 deselected, 2 xfailed, 2 xpassed, 197 warnings in 66.42s (0:01:06) =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment