diff --git a/tests/test_sscursor.py b/tests/test_sscursor.py index c020fe81..203d7d09 100644 --- a/tests/test_sscursor.py +++ b/tests/test_sscursor.py @@ -1,7 +1,7 @@ import asyncio import pytest -from pymysql import NotSupportedError +from pymysql import NotSupportedError, InternalError from aiomysql import ProgrammingError, InterfaceError from aiomysql.cursors import SSCursor @@ -188,3 +188,19 @@ async def read_cursor(): with pytest.raises(InterfaceError): await conn.cursor(SSCursor) + + +@pytest.mark.xfail( + reason="https://github.com/aio-libs/aiomysql/issues/635", + raises=InternalError, + strict=True, +) +@pytest.mark.run_loop +async def test_sscursor_discarded_result(connection): + conn = connection + await _prepare(conn) + async with conn.cursor(SSCursor) as cursor: + await cursor.execute("select 1") + await cursor.execute("select 2") + ret = await cursor.fetchone() + assert (1,) == ret