Skip to content

Instantly share code, notes, and snippets.

View aishwarya-45's full-sized avatar

Aishwarya Mahapatra aishwarya-45

View GitHub Profile
@phillip-lu-axomic
phillip-lu-axomic / conftest.py
Created February 21, 2020 00:49
Pytest function that reorders the test execution order based on dependencies.
# guess we're spinning up our own reordering function
def pytest_collection_modifyitems(config, items):
"""
After collection, this will reorder the function test ordering by dependency.
Here's what we're gonna do:
bucket the functions by their parents
For each parent bucket, iterate over all functions, keeping track of dependency tree.
Start doing BFS down the dependency tree.
TODO: check for circular dependency