]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test(c): test UUID.__slots__
authorhenadzit <henadzi.tsaryk@gmail.com>
Fri, 7 Feb 2025 17:03:43 +0000 (18:03 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 20 Feb 2025 10:15:41 +0000 (11:15 +0100)
tests/types/test_uuid.py

index 6dd8232924e244072154ba17982648ff5e93a80f..94dbabde23fcc723a1befaf73dd38a5f68a0b7fb 100644 (file)
@@ -47,6 +47,11 @@ def test_uuid_load(conn, fmt_out, val):
     assert res.int == uuid_val.int
     assert res.bytes == uuid_val.bytes
     assert res.is_safe == uuid_val.is_safe
+    #  https://github.com/python/typeshed/issues/8832
+    slots = ("int", "is_safe", "__weakref__")
+    assert (
+        UUID.__slots__ == slots  # type: ignore[attr-defined]
+    ), "UUID structure changed"
 
 
 @pytest.mark.slow