Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion tests/benchmarking/test_benchmarking.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def large_graph():
f"{DEEP_PACKAGE}.application.3242334296.2454157946",
)


TOP_LEVEL_PACKAGE_DEPENDENCIES = {
PackageDependency(
importer="mypackage.domain",
Expand Down Expand Up @@ -423,3 +422,19 @@ def test_no_chains(self, large_graph, benchmark):

def test_copy_graph(large_graph, benchmark):
_run_benchmark(benchmark, lambda: deepcopy(large_graph))


def test_graph_contains_module(large_graph, benchmark):
def f(n):
for i in range(n):
_ = f"foo{i}" in large_graph.modules

_run_benchmark(benchmark, f, 100)


def test_iterate_over_modules_in_graph(large_graph, benchmark):
def f():
for module in large_graph.modules:
_ = module

_run_benchmark(benchmark, f)
Loading