Created
May 14, 2015 10:50
-
-
Save davidszotten/dfb550a574f62d06b5dc to your computer and use it in GitHub Desktop.
pytest fixture lineage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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