From: Daniele Varrazzo Date: Thu, 29 Oct 2020 13:54:59 +0000 (+0100) Subject: Dropped duplicate tests X-Git-Tag: 3.0.dev0~416 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f297a59ea3a51e315e33eb3f9d3da91d14f50dc0;p=thirdparty%2Fpsycopg.git Dropped duplicate tests --- diff --git a/tests/types/test_numeric.py b/tests/types/test_numeric.py index e07b59026..8f4d349f6 100644 --- a/tests/types/test_numeric.py +++ b/tests/types/test_numeric.py @@ -364,36 +364,6 @@ def test_numeric_as_float(conn, val): # -@pytest.mark.parametrize("fmt_in", [Format.TEXT, Format.BINARY]) -@pytest.mark.parametrize("fmt_out", [Format.TEXT, Format.BINARY]) -@pytest.mark.parametrize("b", [True, False, None]) -def test_roundtrip_bool(conn, b, fmt_in, fmt_out): - cur = conn.cursor(format=fmt_out) - ph = "%s" if fmt_in == Format.TEXT else "%b" - result = cur.execute(f"select {ph}", (b,)).fetchone()[0] - assert cur.pgresult.fformat(0) == fmt_out - if b is not None: - assert cur.pgresult.ftype(0) == builtins["bool"].oid - assert result is b - - result = cur.execute(f"select {ph}", ([b],)).fetchone()[0] - assert cur.pgresult.fformat(0) == fmt_out - if b is not None: - assert cur.pgresult.ftype(0) == builtins["bool"].array_oid - assert result[0] is b - - -@pytest.mark.parametrize("val", [True, False]) -def test_quote_bool(conn, val): - - tx = Transformer() - assert tx.get_dumper(val, 0).quote(val) == str(val).lower().encode("ascii") - - cur = conn.cursor() - cur.execute(sql.SQL("select {v}").format(v=sql.Literal(val))) - assert cur.fetchone()[0] is val - - @pytest.mark.parametrize("pgtype", [None, "float8", "int8", "numeric"]) def test_minus_minus(conn, pgtype): cur = conn.cursor()