class ClientCursor(ClientCursorMixin["Connection[Row]", Row], Cursor[Row]):
- pass
+ __module__ = "psycopg"
class AsyncClientCursor(
ClientCursorMixin["AsyncConnection[Row]", Row], AsyncCursor[Row]
):
- pass
+ __module__ = "psycopg"
def test_str(conn):
cur = conn.cursor()
+ assert "psycopg.ClientCursor" in str(cur)
assert "[IDLE]" in str(cur)
assert "[closed]" not in str(cur)
assert "[no result]" in str(cur)
async def test_str(aconn):
cur = aconn.cursor()
+ assert "psycopg.AsyncClientCursor" in str(cur)
assert "[IDLE]" in str(cur)
assert "[closed]" not in str(cur)
assert "[no result]" in str(cur)
def test_str(conn):
cur = conn.cursor()
+ assert "psycopg.Cursor" in str(cur)
assert "[IDLE]" in str(cur)
assert "[closed]" not in str(cur)
assert "[no result]" in str(cur)
async def test_str(aconn):
cur = aconn.cursor()
+ assert "psycopg.AsyncCursor" in str(cur)
assert "[IDLE]" in str(cur)
assert "[closed]" not in str(cur)
assert "[no result]" in str(cur)
def test_repr(conn):
cur = conn.cursor("my-name")
- assert "ServerCursor" in repr(cur)
+ assert "psycopg.ServerCursor" in str(cur)
assert "my-name" in repr(cur)
cur.close()
async def test_repr(aconn):
cur = aconn.cursor("my-name")
- assert "AsyncServerCursor" in repr(cur)
+ assert "psycopg.AsyncServerCursor" in str(cur)
assert "my-name" in repr(cur)
await cur.close()