def METHOD_NAME(sess2, trans):  # pylint: disable=unused-variable
    # Detecting whether this is indeed the nested transaction of the test
    if trans.nested and not trans._parent.nested:  # pylint: disable=protected-access
        # Handle where test DOESN'T session.commit(),
        sess2.expire_all()
        sess.begin_nested()