Skip to content

Instantly share code, notes, and snippets.

@davidszotten
Created May 14, 2015 10:50
Show Gist options
  • Select an option

  • Save davidszotten/dfb550a574f62d06b5dc to your computer and use it in GitHub Desktop.

Select an option

Save davidszotten/dfb550a574f62d06b5dc to your computer and use it in GitHub Desktop.
pytest fixture lineage
def get_lineage(request):
name = request.fixturename
node = str(request.node)
try:
return [name] + get_lineage(request._parent_request)
except AttributeError:
return [node]
print ' <- '.join(get_lineage(request))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment