def role(app):
    """Fixture for creating a temporary role

    Each time the fixture is used, a new role is created

    The role is deleted after the test
    """
    role = orm.Role(name=new_role_name())
    app.db.add(role)
    app.db.commit()
    yield role
    app.db.delete(role)
    app.db.commit()
Fixture for creating a temporary role

Each time the fixture is used, a new role is created

The role is deleted after the test
jupyterhub/tests/conftest.py