(dsn, caplog)
| 298 | |
| 299 | @pytest.mark.crdb_skip("backend pid") |
| 300 | async def test_inerror_rollback(dsn, caplog): |
| 301 | caplog.set_level(logging.WARNING, logger="psycopg.pool") |
| 302 | |
| 303 | async with pool.AsyncConnectionPool(dsn, min_size=1) as p: |
| 304 | conn = await p.getconn() |
| 305 | pid = conn.info.backend_pid |
| 306 | with pytest.raises(psycopg.ProgrammingError): |
| 307 | await conn.execute("wat") |
| 308 | assert conn.info.transaction_status == TransactionStatus.INERROR |
| 309 | await p.putconn(conn) |
| 310 | |
| 311 | async with p.connection() as conn2: |
| 312 | assert conn2.info.backend_pid == pid |
| 313 | assert conn2.info.transaction_status == TransactionStatus.IDLE |
| 314 | |
| 315 | assert len(caplog.records) == 1 |
| 316 | assert "INERROR" in caplog.records[0].message |
| 317 | |
| 318 | |
| 319 | @pytest.mark.crdb_skip("backend pid") |
nothing calls this directly
no test coverage detected