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