httpie-cli/tests
Miro Hrončok 3865fabf09
Adapt doctest of tests.utils.http to work on Python 3.10 as well (#1075)
https://docs.python.org/3.10/whatsnew/3.10.html#enum

Python 3.10 changed the repr of enum members, and the doctest of tests.utils.http failed.
Exact reprs are unfortunately not considered stable API between Python releases:

    =================================== FAILURES ===================================
    __________________________ [doctest] tests.utils.http __________________________
    209
    210     Example:
    211
    212     $ http --auth=user:password GET pie.dev/basic-auth/user/password
    213
    214         >>> httpbin = getfixture('httpbin')
    215         >>> r = http('-a', 'user:pw', httpbin.url + '/basic-auth/user/pw')
    216         >>> type(r) == StrCLIResponse
    217         True
    218         >>> r.exit_status
    Expected:
        <ExitStatus.SUCCESS: 0>
    Got:
        ExitStatus.SUCCESS

A simple replacement of the expected output however breaks the doctest on Python 3.9.

This is the best solution I could think of
that keeps the docstring readable and doctest working in Pythons both old and new.
2021-05-27 19:54:33 +02:00
..
client_certs Quieten ssl tests (#952) 2020-08-06 22:24:03 +02:00
fixtures Fix fixture encoding on Windows 2020-09-28 12:53:28 +02:00
utils Adapt doctest of tests.utils.http to work on Python 3.10 as well (#1075) 2021-05-27 19:54:33 +02:00
__init__.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00
conftest.py Skip http://pie.dev tests when offline (#1072) 2021-05-27 19:30:36 +02:00
README.rst Update URLs 2020-12-23 22:07:27 +01:00
test_auth_plugins.py Modernize the code base with f-strings in tests (#1069) 2021-05-26 14:09:38 +02:00
test_auth.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00
test_binary.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00
test_cli.py Modernize the code base with f-strings in tests (#1069) 2021-05-26 14:09:38 +02:00
test_compress.py Add --raw to allow specifying the raw request body as an alternative to stdin (#1062) 2021-05-24 14:29:54 +02:00
test_config.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00
test_defaults.py Add --raw to allow specifying the raw request body as an alternative to stdin (#1062) 2021-05-24 14:29:54 +02:00
test_docs.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00
test_downloads.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00
test_errors.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00
test_exit_status.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00
test_httpie.py Modernize the code base with f-strings in tests (#1069) 2021-05-26 14:09:38 +02:00
test_offline.py Add --raw to allow specifying the raw request body as an alternative to stdin (#1062) 2021-05-24 14:29:54 +02:00
test_output.py Modernize the code base with f-strings in tests (#1069) 2021-05-26 14:09:38 +02:00
test_redirects.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00
test_regressions.py Modernize the code base with f-strings in tests (#1069) 2021-05-26 14:09:38 +02:00
test_sessions.py Polish Python 2 removal (#1070) 2021-05-27 13:05:41 +02:00
test_ssl.py Modernize the code base with f-strings in tests (#1069) 2021-05-26 14:09:38 +02:00
test_stream.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00
test_tokens.py Skip http://pie.dev tests when offline (#1072) 2021-05-27 19:30:36 +02:00
test_unicode.py Polish Python 2 removal (#1070) 2021-05-27 13:05:41 +02:00
test_uploads.py Skip http://pie.dev tests when offline (#1072) 2021-05-27 19:30:36 +02:00
test_windows.py Use relative imports (#1057) 2021-05-05 14:13:39 +02:00

HTTPie Test Suite
=================


Please see `CONTRIBUTING`_.


.. _CONTRIBUTING: https://github.com/httpie/httpie/blob/master/CONTRIBUTING.rst