============================= test session starts ============================== platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-0.13.1 rootdir: /build/python-aioconsole/src/aioconsole-0.3.3, configfile: setup.cfg plugins: repeat-0.9.1, asyncio-0.16.0, cov-2.12.1 collected 134 items tests/test_apython.py .................................................. [ 37%] .......................... [ 56%] tests/test_command.py ............ [ 65%] tests/test_execute.py .......... [ 73%] tests/test_interact.py ....FF........ [ 83%] tests/test_server.py ...... [ 88%] tests/test_stream.py ................ [100%] =================================== FAILURES =================================== _______________________ test_interact_syntax_error[1-2] ________________________ event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False> monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x40049814e0> @pytest.mark.asyncio async def test_interact_syntax_error(event_loop, monkeypatch): with stdcontrol(event_loop, monkeypatch) as (reader, writer): writer.write("a b\n") await writer.drain() writer.stream.close() banner = "A BANNER" await interact(banner=banner, stop=False) await assert_stream(reader, banner) # Skip line await reader.readline() await assert_stream(reader, " a b") if sys.version_info < (3, 10): await assert_stream(reader, " ^", loose=True) await assert_stream(reader, "SyntaxError: invalid syntax") else: > await assert_stream(reader, " ^^^", loose=True) tests/test_interact.py:98: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ stream = expected = ' ^^^', loose = True async def assert_stream(stream, expected, loose=False): s = None if loose else "\n" for expected_line in expected.splitlines(): line = await stream.readline() > assert expected_line.strip(s) == line.decode().strip(s) E AssertionError: assert '^^^' == '^' E - ^ E + ^^^ tests/test_interact.py:38: AssertionError _______________________ test_interact_syntax_error[2-2] ________________________ event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False> monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x409da918a0> @pytest.mark.asyncio async def test_interact_syntax_error(event_loop, monkeypatch): with stdcontrol(event_loop, monkeypatch) as (reader, writer): writer.write("a b\n") await writer.drain() writer.stream.close() banner = "A BANNER" await interact(banner=banner, stop=False) await assert_stream(reader, banner) # Skip line await reader.readline() await assert_stream(reader, " a b") if sys.version_info < (3, 10): await assert_stream(reader, " ^", loose=True) await assert_stream(reader, "SyntaxError: invalid syntax") else: > await assert_stream(reader, " ^^^", loose=True) tests/test_interact.py:98: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ stream = expected = ' ^^^', loose = True async def assert_stream(stream, expected, loose=False): s = None if loose else "\n" for expected_line in expected.splitlines(): line = await stream.readline() > assert expected_line.strip(s) == line.decode().strip(s) E AssertionError: assert '^^^' == '^' E - ^ E + ^^^ tests/test_interact.py:38: AssertionError ---------- coverage: platform linux, python 3.10.1-final-0 ----------- Name Stmts Miss Cover -------------------------------------------- aioconsole/__init__.py 9 0 100% aioconsole/__main__.py 2 0 100% aioconsole/apython.py 81 4 95% aioconsole/command.py 61 7 89% aioconsole/compat.py 3 0 100% aioconsole/console.py 184 13 93% aioconsole/events.py 45 5 89% aioconsole/execute.py 51 4 92% aioconsole/rlwrap.py 87 10 89% aioconsole/server.py 56 16 71% aioconsole/stream.py 174 0 100% -------------------------------------------- TOTAL 753 59 92% =========================== short test summary info ============================ FAILED tests/test_interact.py::test_interact_syntax_error[1-2] - AssertionErr... FAILED tests/test_interact.py::test_interact_syntax_error[2-2] - AssertionErr... ======================== 2 failed, 132 passed in 24.18s ======================== ==> ERROR: A failure occurred in check().  Aborting...