========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= test session starts ==========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
platform linux -- Python 3.10.12, pytest-9.0.3, pluggy-1.6.0 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.10.12', 'Platform': 'Linux-6.8.0-1026-gke-x86_64-with-glibc2.35', 'Packages': {'pytest': '9.0.3', 'pluggy': '1.6.0'}, 'Plugins': {'metadata': '3.1.1', 'anyio': '4.13.0', 'cov': '7.1.0', 'json-report': '1.5.0'}}
rootdir: /workspace/imapclient
configfile: pyproject.toml
plugins: metadata-3.1.1, anyio-4.13.0, cov-7.1.0, json-report-1.5.0
collected 55 items

tests/test_response_parser.py::TestParseResponse::test_bad_literal FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [  1%]
tests/test_response_parser.py::TestParseResponse::test_bad_quoting FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [  3%]
tests/test_response_parser.py::TestParseResponse::test_complex_mixed PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [  5%]
tests/test_response_parser.py::TestParseResponse::test_deeper_nest_tuple PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [  7%]
tests/test_response_parser.py::TestParseResponse::test_empty_tuple PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [  9%]
tests/test_response_parser.py::TestParseResponse::test_envelopey PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [ 10%]
tests/test_response_parser.py::TestParseResponse::test_envelopey_quoted PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   [ 12%]
tests/test_response_parser.py::TestParseResponse::test_incomplete_tuple FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   [ 14%]
tests/test_response_parser.py::TestParseResponse::test_int PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [ 16%]
tests/test_response_parser.py::TestParseResponse::test_int_and_tuple PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [ 18%]
tests/test_response_parser.py::TestParseResponse::test_int_zero PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           [ 20%]
tests/test_response_parser.py::TestParseResponse::test_literal PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [ 21%]
tests/test_response_parser.py::TestParseResponse::test_literal_with_more PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [ 23%]
tests/test_response_parser.py::TestParseResponse::test_nested_tuple PASSED                                                                                                                                                                                                                                                                                                                                                                                               <response clipped><NOTE>Due to the max output limit, only part of the full response has been shown to you.</NOTE>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _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_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

tokens = <imapclient.response_lexer.TokenSource object at 0x7dc396a6d5a0>

    def _parse_fetch_item(tokens: TokenSource) -> Tuple[Optional[int], Dict[bytes, Any]]:
        tok_iter = iter(tokens)

        try:
            msg_id_tok = next(tok_iter)
        except StopIteration:
            return None, {}

        try:
            msg_id = int(msg_id_tok)
        except ValueError:
>           raise ProtocolError('Unexpected fetch response: %r' % msg_id_tok)
E           imapclient.exceptions.ProtocolError: Unexpected fetch response: b')'

imapclient/response_parser.py:145: ProtocolError
______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestParseFetchResponse.test_partial_fetch _______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

tokens = <imapclient.response_lexer.TokenSource object at 0x7dc396a7b0d0>

    def _parse_fetch_item(tokens: TokenSource) -> Tuple[Optional[int], Dict[bytes, Any]]:
        tok_iter = iter(tokens)

        try:
            msg_id_tok = next(tok_iter)
        except StopIteration:
            return None, {}

        try:
>           msg_id = int(msg_id_tok)
E           ValueError: invalid literal for int() with base 10: b')'

imapclient/response_parser.py:143: ValueError

During handling of the above exception, another exception occurred:

self = <tests.test_response_parser.TestParseFetchResponse testMethod=test_partial_fetch>

    def test_partial_fetch(self):
        body = b"01234567890123456789"
        self.assertEqual(
>           parse_fetch_response([(b"123 (UID 367 BODY[]<0> {20}", body), b")"]),
            {367: {b"BODY[]<0>": body, b"SEQ": 123}},
        )

tests/test_response_parser.py:492:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _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 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

tokens = <imapclient.response_lexer.TokenSource object at 0x7dc396a7b0d0>

    def _parse_fetch_item(tokens: TokenSource) -> Tuple[Optional[int], Dict[bytes, Any]]:
        tok_iter = iter(tokens)

        try:
            msg_id_tok = next(tok_iter)
        except StopIteration:
            return None, {}

        try:
            msg_id = int(msg_id_tok)
        except ValueError:
>           raise ProtocolError('Unexpected fetch response: %r' % msg_id_tok)
E           imapclient.exceptions.ProtocolError: Unexpected fetch response: b')'

imapclient/response_parser.py:145: ProtocolError
_______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestParseFetchResponse.test_simple_pairs _______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_response_parser.TestParseFetchResponse testMethod=test_simple_pairs>

    def test_simple_pairs(self):
>       self.assertEqual(
            parse_fetch_response([b'23 (ABC 123 StUfF "hello")']),
            {23: {b"ABC": 123, b"STUFF": b"hello", b"SEQ": 23}},
        )
E       AssertionError: defaultdict(<class 'dict'>, {23: {b'SEQ': 23, b'ABC': 123, b'StUfF': b'hello'}}) != {23: {b'ABC': 123, b'STUFF': b'hello', b'SEQ': 23}}

tests/test_response_parser.py:242: AssertionError
======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= short test summary info ========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
FAILED tests/test_response_parser.py::TestParseResponse::test_bad_literal - AssertionError: ProtocolError not raised by parse_response
FAILED tests/test_response_parser.py::TestParseResponse::test_bad_quoting - ValueError: No closing '"'
FAILED tests/test_response_parser.py::TestParseResponse::test_incomplete_tuple - AssertionError: "Tuple incomplete before "\(1 2"" does not match "Tuple incomplete"
FAILED tests/test_response_parser.py::TestParseResponse::test_square_brackets - AssertionError: Sequences differ: (b'foo[bar', b'rrr]') != (b'foo[bar rrr]',)
FAILED tests/test_response_parser.py::TestParseMessageList::test_modseq - AssertionError: Sequences differ: [1, 2, 3, 999] != [1, 2, 3]
FAILED tests/test_response_parser.py::TestParseMessageList::test_modseq_interleaved - AssertionError: Sequences differ: [1, 2, 9, 3, 4] != [1, 2, 3, 4]
FAILED tests/test_response_parser.py::TestParseMessageList::test_modseq_no_space - AssertionError: Sequences differ: [1, 2, 3, 999] != [1, 2, 3]
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_Address_str - AttributeError: 'NoneType' object has no attribute 'decode'
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_Address_str_ignores_encoding_error - UnicodeEncodeError: 'ascii' codec can't encode character '\ufffd' in position 1: ordinal not in range(128)
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_BODY - AssertionError: defaultdict(<class 'dict'>, {123: {b'SEQ'[101 chars]1)}}) != {317: {b'BODY': (b'TEXT', b'PLAIN', (b'CH[59 chars]123}}
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_BODYSTRUCTURE - AssertionError: defaultdict(<class 'dict'>, {123: {b'SEQ'[110 chars]1)}}) != {317: {b'BODYSTRUCTURE': (b'TEXT', b'PLAI[68 chars]123}}
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_BODY_HEADER_FIELDS - imapclient.exceptions.ProtocolError: Unexpected fetch response: b')'
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_ENVELOPE - AssertionError: (b'Sun, 24 Mar 2013 22:06:10 +0200', b'su[289 chars]id>') != Envelope(date=datetime.datetime(2013, 3, [593 chars]id>')
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_ENVELOPE_with_empty_addresses - AssertionError: (None, b'subject', ((b'name', None, b'add[317 chars]id>') != Envelope(date=None, subject=b'subject', f[563 chars]id>')
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_ENVELOPE_with_invalid_date - AssertionError: (b'wtf', b'subject', None, None, None, No[41 chars]id>') != Envelope(date=None, subject=b'subject', f[115 chars]id>')
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_ENVELOPE_with_no_date - AssertionError: (None, b'subject', None, None, None, None[39 chars]id>') != Envelope(date=None, subject=b'subject', f[115 chars]id>')
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_INTERNALDATE - AssertionError: b' 9-Feb-2007 17:08:08 -0430' != datetime.datetime(2007, 2, 9, 17, 8, 8, t[64 chars]650>)
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_INTERNALDATE_normalised - AttributeError: 'bytes' object has no attribute 'tzinfo'
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_UID - AssertionError: defaultdict(<class 'dict'>, {23: {b'SEQ': 23, b'UID': 76}}) != {76: {b'SEQ': 23}}
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_literals - imapclient.exceptions.ProtocolError: Unexpected fetch response: b'RFC822'
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_literals_and_keys_with_square_brackets - imapclient.exceptions.ProtocolError: Unexpected fetch response: b')'
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_mixed_types - imapclient.exceptions.ProtocolError: Unexpected fetch response: b')'
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_partial_fetch - imapclient.exceptions.ProtocolError: Unexpected fetch response: b')'
FAILED tests/test_response_parser.py::TestParseFetchResponse::test_simple_pairs - AssertionError: defaultdict(<class 'dict'>, {23: {b'SEQ': 23, b'ABC': 123, b'StUfF': b'hello'}}) != {23: {b'ABC': 123, b'STUFF': b'hello', b'SEQ': 23}}
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== 24 failed, 31 passed in 0.30s =====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
[The command completed with exit code 1.]
[Current working directory: /workspace/imapclient]
[Python interpreter: /usr/bin/python]
[Command finished with exit code 1]