Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 7 additions & 4 deletions tests/benchmark/test_filter_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
@pytest.mark.parametrize(
("width", "depth"),
(
# note that the expected number of objects is roughly "WIDTH raised to DEPTH"
# so relatively modest numbers like 5x10 = 5 to the 10th = 9.7 million
# be careful to build wide-but-shallow or deep-but-narrow trees
pytest.param(1, 1, id="1w-1d"),
# Note that the expected number of objects is roughly "WIDTH raised to DEPTH"
# so relatively modest numbers like 5x10 = 5 to the 10th = 9.7 million.
# Be careful to build wide-but-shallow or deep-but-narrow trees.
#
# Experientially, the 1x1 benchmark is so fast that it actually starts to
# measure noise -- e.g., from memory layout in CPython being perturbed.
# Therefore it is omitted and we start at the modest 1x5 and 5x1 shapes.
pytest.param(5, 1, id="5w-1d"),
pytest.param(1, 5, id="1w-5d"),
pytest.param(1, 1000, id="1w-1000d"),
Expand Down
7 changes: 6 additions & 1 deletion tests/benchmark/test_scope_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from globus_sdk.scopes import ScopeParser
from globus_sdk.scopes import ScopeParser, TransferScopes


def _make_deep_scope(depth):
Expand All @@ -20,6 +20,11 @@ def _make_wide_scope(width):
return big_scope


def test_ordinary_scope_parsing(benchmark):
scope_string = f"openid profile {TransferScopes.all}"
benchmark(ScopeParser.parse, scope_string)


@pytest.mark.parametrize("depth", (10, 100, 1000, 2000, 3000, 4000, 5000))
def test_deep_scope_parsing(benchmark, depth):
scope_string = _make_deep_scope(depth)
Expand Down
Loading