def slug(request, cl_admin): def remove_by_slug(): try: cl_admin.delete_project(slug) except (ValueError, JIRAError): # Some tests have project already removed, so we stay silent pass slug = get_unique_project_name() project_name = ("Test user=%s key=%s A" % (getpass.getuser(), slug)) try: proj = cl_admin.project(slug) except JIRAError: proj = cl_admin.create_project(slug, project_name) assert proj request.addfinalizer(remove_by_slug) return slug
def slug(request, cl_admin): def remove_by_slug(): try: cl_admin.delete_project(slug) except ValueError: # Some tests have project already removed, so we stay silent pass slug = get_unique_project_name() project_name = ( "Test user=%s key=%s A" % (getpass.getuser(), slug) ) try: proj = cl_admin.project(slug) except JIRAError: proj = cl_admin.create_project(slug, project_name) assert proj request.addfinalizer(remove_by_slug) return slug