MCPcopy
hub / github.com/psycopg/psycopg / test_set_transaction_param_implicit

Function test_set_transaction_param_implicit

tests/test_connection.py:714–727  ·  view source on GitHub ↗
(conn, param, autocommit)

Source from the content-addressed store, hash-verified

712@pytest.mark.parametrize("autocommit", [True, False])
713@pytest.mark.parametrize("param", tx_params_isolation)
714def test_set_transaction_param_implicit(conn, param, autocommit):
715 conn.set_autocommit(autocommit)
716 for value in param.values:
717 getattr(conn, f"set_{param.name}")(value)
718 cur = conn.execute(
719 "select current_setting(%s), current_setting(%s)",
720 [f"transaction_{param.guc}", f"default_transaction_{param.guc}"],
721 )
722 pgval, default = cur.fetchone()
723 if autocommit:
724 assert pgval == default
725 else:
726 assert tx_values_map[pgval] == value
727 conn.rollback()
728
729
730@pytest.mark.parametrize("param", tx_params_isolation)

Callers

nothing calls this directly

Calls 4

set_autocommitMethod · 0.45
executeMethod · 0.45
fetchoneMethod · 0.45
rollbackMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…