From: Daniele Varrazzo Date: Mon, 11 Jan 2021 15:04:11 +0000 (+0100) Subject: Added test to reproduce array bug found with random data X-Git-Tag: 3.0.dev0~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d01dafbb3574fa3284c6e9ca54ce765eed905d21;p=thirdparty%2Fpsycopg.git Added test to reproduce array bug found with random data --- diff --git a/tests/types/test_array.py b/tests/types/test_array.py index 591901cfa..9de51c14a 100644 --- a/tests/types/test_array.py +++ b/tests/types/test_array.py @@ -139,3 +139,14 @@ def test_array_mixed_numbers(array, type): dumper = tx.get_dumper(array, Format.BINARY) dumper.dump(array) assert dumper.oid == builtins[type].array_oid + + +@pytest.mark.xfail +@pytest.mark.parametrize("fmt_in", [Format.BINARY]) # TODO: add Format.TEXT +def test_empty_list_mix(conn, fmt_in): + ph = "%s" if fmt_in == Format.TEXT else "%b" + objs = list(range(3)) + # pro tip: don't get confused with the types + f1, f2 = conn.execute(f"select {ph}, {ph}", (objs, [])).fetchone() + assert f1 == objs + assert f2 == []