assert conn.autocommit
+@pytest.mark.crdb("skip", reason="backend pid")
def test_its_no_pool_at_all(dsn):
with NullConnectionPool(dsn, max_size=2) as p:
with p.connection() as conn:
assert "WAT" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
def test_reset(dsn):
resets = 0
assert pids[0] == pids[1]
+@pytest.mark.crdb("skip", reason="backend pid")
def test_reset_badstate(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert "INTRANS" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
def test_reset_broken(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert 0.1 < e[1] < 0.15
+@pytest.mark.crdb("skip", reason="backend pid")
def test_broken_reconnect(dsn):
with NullConnectionPool(dsn, max_size=1) as p:
with p.connection() as conn:
assert pid1 != pid2
+@pytest.mark.crdb("skip", reason="backend pid")
def test_intrans_rollback(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
pids = []
assert "INTRANS" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
def test_inerror_rollback(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
pids = []
assert "INERROR" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
def test_active_close(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
pids = []
assert "BAD" in caplog.records[1].message
+@pytest.mark.crdb("skip", reason="backend pid")
def test_fail_rollback_close(dsn, caplog, monkeypatch):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
pids = []
assert conn.autocommit
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_its_no_pool_at_all(dsn):
async with AsyncNullConnectionPool(dsn, max_size=2) as p:
async with p.connection() as conn:
assert "WAT" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_reset(dsn):
resets = 0
assert pids[0] == pids[1]
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_reset_badstate(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert "INTRANS" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_reset_broken(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert 0.1 < e[1] < 0.15
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_broken_reconnect(dsn):
async with AsyncNullConnectionPool(dsn, max_size=1) as p:
async with p.connection() as conn:
assert pid1 != pid2
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_intrans_rollback(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
pids = []
assert "INTRANS" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_inerror_rollback(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
pids = []
assert "INERROR" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_active_close(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
pids = []
assert "BAD" in caplog.records[1].message
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_fail_rollback_close(dsn, caplog, monkeypatch):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
pids = []
assert conn.autocommit
+@pytest.mark.crdb("skip", reason="backend pid")
def test_its_really_a_pool(dsn):
with pool.ConnectionPool(dsn, min_size=2) as p:
with p.connection() as conn:
assert p.closed
+@pytest.mark.crdb("skip", reason="backend pid")
def test_connection_not_lost(dsn):
with pool.ConnectionPool(dsn, min_size=1) as p:
with pytest.raises(ZeroDivisionError):
assert resets == 2
+@pytest.mark.crdb("skip", reason="backend pid")
def test_reset_badstate(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert "INTRANS" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
def test_reset_broken(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert 0.1 < e[1] < 0.15
+@pytest.mark.crdb("skip", reason="backend pid")
def test_broken_reconnect(dsn):
with pool.ConnectionPool(dsn, min_size=1) as p:
with p.connection() as conn:
assert pid1 != pid2
+@pytest.mark.crdb("skip", reason="backend pid")
def test_intrans_rollback(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert "INTRANS" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
def test_inerror_rollback(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert "INERROR" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
def test_active_close(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert "BAD" in caplog.records[1].message
+@pytest.mark.crdb("skip", reason="backend pid")
def test_fail_rollback_close(dsn, caplog, monkeypatch):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert pids[0] == pids[1] != pids[4], pids
+@pytest.mark.crdb("skip", reason="backend pid")
def test_check(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
with pool.ConnectionPool(dsn, min_size=4) as p:
assert conn.autocommit
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_its_really_a_pool(dsn):
async with pool.AsyncConnectionPool(dsn, min_size=2) as p:
async with p.connection() as conn:
assert p.closed
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_connection_not_lost(dsn):
async with pool.AsyncConnectionPool(dsn, min_size=1) as p:
with pytest.raises(ZeroDivisionError):
assert resets == 2
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_reset_badstate(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert "INTRANS" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_reset_broken(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert 0.1 < e[1] < 0.15
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_broken_reconnect(dsn):
async with pool.AsyncConnectionPool(dsn, min_size=1) as p:
async with p.connection() as conn:
assert pid1 != pid2
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_intrans_rollback(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert "INTRANS" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_inerror_rollback(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert "INERROR" in caplog.records[0].message
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_active_close(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert "BAD" in caplog.records[1].message
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_fail_rollback_close(dsn, caplog, monkeypatch):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
assert pids[0] == pids[1] != pids[4], pids
+@pytest.mark.crdb("skip", reason="backend pid")
async def test_check(dsn, caplog):
caplog.set_level(logging.WARNING, logger="psycopg.pool")
async with pool.AsyncConnectionPool(dsn, min_size=4) as p: