def test_rollback_on_close(self):
    canary = mock.Mock()
    with testing.db.connect() as conn:
        event.listen(conn, 'rollback', canary)
        conn.execute(select(1))
        assert conn.in_transaction()
    eq_(canary.mock_calls, [mock.call(conn)])
def test_rollback_on_close(self):
    canary = mock.Mock()
    with testing.db.connect() as conn:
        event.listen(conn, 'rollback', canary)
        conn.execute(select(1))
        assert conn.in_transaction()
    eq_(canary.mock_calls, [mock.call(conn)])