Skip to content

Commit 7905447

Browse files
committed
Add more benchmarks
1 parent 25d60ad commit 7905447

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/benchmarking/test_benchmarking.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,26 @@ def test_build_django_from_cache(benchmark):
6868
benchmark(fn)
6969

7070

71+
def test_find_descendants(large_graph, benchmark):
72+
result = benchmark(large_graph.find_descendants, "mypackage")
73+
assert len(result) == 28222
74+
75+
76+
def test_find_downstream_modules(large_graph, benchmark):
77+
result = benchmark(large_graph.find_downstream_modules, DEEP_LAYERS[0], as_package=True)
78+
assert len(result) == 80
79+
80+
81+
def test_find_upstream_modules(large_graph, benchmark):
82+
result = benchmark(large_graph.find_upstream_modules, DEEP_LAYERS[0], as_package=True)
83+
assert len(result) == 2159
84+
85+
86+
def test_find_shortest_chain(large_graph, benchmark):
87+
result = benchmark(large_graph.find_shortest_chain, DEEP_LAYERS[0], DEEP_LAYERS[1])
88+
assert result is not None and len(result) == 5
89+
90+
7191
def test_find_shortest_chain__no_chain(large_graph, benchmark):
7292
result = benchmark(
7393
large_graph.find_shortest_chain,

0 commit comments

Comments
 (0)