def test_rollback_recover(self):
        users, User = self.tables.users, self.classes.User

        mapper(User, users)

        session = sessionmaker()()

        u1, u2, u3 = User(name='u1'), User(name='u2'), User(name='u3')

        session.add_all([u1, u2, u3])

        session.commit()

        session.delete(u2)
        u4 = User(name='u2')
        session.add(u4)
        session.flush()

        u5 = User(name='u3')
        session.add(u5)
        assert_raises(orm_exc.FlushError, session.flush)

        assert session not in u5
        assert u2 not in session.deleted

        session.rollback()
dataset/ETHPy150Open zzzeek/sqlalchemy/test/orm/test_transaction.py/NaturalPKRollbackTest.test_rollback_recover/swapped operands of `not in`