diff --git a/tests/test_cursors.py b/tests/test_cursors.py index 0df6391..d941a67 100644 --- a/tests/test_cursors.py +++ b/tests/test_cursors.py @@ -213,7 +213,7 @@ async def async_cursor( request_settings=ydb.BaseRequestSettings(), ) yield cursor - await greenlet_spawn(cursor.close) + cursor.close() @pytest.mark.asyncio async def test_cursor_fetch_one(self, async_cursor: AsyncCursor) -> None: diff --git a/ydb_dbapi/cursors.py b/ydb_dbapi/cursors.py index 506f834..66b7ac8 100644 --- a/ydb_dbapi/cursors.py +++ b/ydb_dbapi/cursors.py @@ -350,7 +350,6 @@ def close(self) -> None: if self._state == CursorStatus.closed: return - self._scroll_stream() self._state = CursorStatus.closed def __enter__(self) -> Self: @@ -527,11 +526,10 @@ async def _scroll_stream(self, replace_current: bool = True) -> None: self._state = CursorStatus.finished - async def close(self) -> None: + def close(self) -> None: if self._state == CursorStatus.closed: return - await self._scroll_stream() self._state = CursorStatus.closed async def __aenter__(self) -> Self: @@ -543,4 +541,4 @@ async def __aexit__( exc: BaseException | None, tb: object, ) -> None: - await self.close() + self.close()