From 018af447ab15e4167ce49d7031f80af678bae210 Mon Sep 17 00:00:00 2001 From: Richard Schwab Date: Sat, 29 Jan 2022 00:02:59 +0100 Subject: [PATCH] add xfailing test case for #635 (#700) --- tests/test_sscursor.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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