]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test: skip testing random multirange arrays with empty last elements
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 14 May 2022 22:24:17 +0000 (00:24 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 14 May 2022 22:28:18 +0000 (00:28 +0200)
Previously we were skipping the ones with an empty first element,
because of a known shortcoming in finding the right OID. Now that we
scan the whole array to find all the elements' classes, it's the last
entry which might break dumping.

tests/fix_faker.py

index 39031e8b47ca84c2451a15b20eb0275b332f3ead..86c3c0ee809b13ea1f346b922e092c2e3de9b145 100644 (file)
@@ -491,10 +491,10 @@ class Faker:
         while 1:
             rv = [self.make(spec) for i in range(length)]
 
-            # TODO multirange lists fail binary dump if the first element is
+            # TODO multirange lists fail binary dump if the last element is
             # empty and there is no type annotation. See xfail in
             # test_multirange::test_dump_builtin_array
-            if rv and isinstance(rv[0], Multirange) and not rv[0]:
+            if rv and isinstance(rv[-1], Multirange) and not rv[-1]:
                 continue
 
             return rv