]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix: set ClientCursor class module to psycopg
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 13 May 2022 00:21:10 +0000 (02:21 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 15 May 2022 09:15:30 +0000 (11:15 +0200)
psycopg/psycopg/client_cursor.py
tests/test_client_cursor.py
tests/test_client_cursor_async.py
tests/test_cursor.py
tests/test_cursor_async.py
tests/test_server_cursor.py
tests/test_server_cursor_async.py

index a61d10234383977e7248fbd34be943248a1f7d4d..9c560bb3d20c2fbd6f39e41a375f47191d720db9 100644 (file)
@@ -81,10 +81,10 @@ class ClientCursorMixin(BaseCursor[ConnectionType, Row]):
 
 
 class ClientCursor(ClientCursorMixin["Connection[Row]", Row], Cursor[Row]):
-    pass
+    __module__ = "psycopg"
 
 
 class AsyncClientCursor(
     ClientCursorMixin["AsyncConnection[Row]", Row], AsyncCursor[Row]
 ):
-    pass
+    __module__ = "psycopg"
index df202ea7b3438748127d07c29f319a739fa46bdf..8b403c182bba177a6e6de985d24efac45e9542cf 100644 (file)
@@ -731,6 +731,7 @@ class TestColumn:
 
 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)
index 988ea57ec1c998dae471b14d4378d2542b364908..780d81706f86dda011b7eac0ee1f3b72d3b0cb11 100644 (file)
@@ -605,6 +605,7 @@ async def test_stream(aconn):
 
 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)
index a52b3fc374b412481039cfdb63937bbb4402e25b..29c726c33c905452d252f1dbdfc00e683f197c0f 100644 (file)
@@ -778,6 +778,7 @@ class TestColumn:
 
 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)
index ea5bf7b139df02342f4e38cebfe346adbfe8f6d4..6d63bed14dfa1206528e5ee47ba921d53d3fe148 100644 (file)
@@ -649,6 +649,7 @@ async def test_stream_binary_cursor_text_override(aconn):
 
 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)
index 78b51ce00bfc2bfa10c3f74eb1fe04672bbfa98b..e1a9da446a89e37761a74dd7e5eee1efebe07b90 100644 (file)
@@ -42,7 +42,7 @@ def test_funny_name(conn):
 
 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()
 
index 6b2b9a5e52bfb71b811a055bff8a3b6dd4075ace..8ccf68651cbd9dd8fca5efee0f6bb24afc4cfba6 100644 (file)
@@ -48,7 +48,7 @@ async def test_funny_name(aconn):
 
 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()