Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alxckn committed Aug 5, 2024
1 parent 2a6d879 commit f2f8f61
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/sentry/ownership/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ def test_frames(
match_frame_value_func: Callable[[str | None, str], bool] = lambda val, pattern: bool(
glob_match(val, pattern, ignorecase=True, path_normalize=True)
),
match_frame_func: Callable[[Sequence[Mapping[str, Any]]], bool] = lambda frame: bool(
True
),
match_frame_func: Callable[[Sequence[Mapping[str, Any]]], bool] = lambda frame: bool(True),
) -> bool:
for frame in (f for f in frames if isinstance(f, Mapping)):
if not match_frame_func(frame):
Expand Down
24 changes: 21 additions & 3 deletions tests/sentry/ownership/test_grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,9 +984,27 @@ def test_convert_codeowners_syntax_excludes_invalid():
@pytest.mark.parametrize(
"path_details, expected",
[
([{"filename": "foo/test.py", "in_app": False}, {"abs_path": "/usr/local/src/foo/test.py", "in_app": False}], False),
([{"filename": "foo/test.py", "in_app": True}, {"abs_path": "/usr/local/src/foo/test.py", "in_app": True}], True),
([{"filename": "foo/test.py", "in_app": False}, {"abs_path": "/usr/local/src/foo/test.py", "in_app": True}], True),
(
[
{"filename": "foo/test.py", "in_app": False},
{"abs_path": "/usr/local/src/foo/test.py", "in_app": False},
],
False,
),
(
[
{"filename": "foo/test.py", "in_app": True},
{"abs_path": "/usr/local/src/foo/test.py", "in_app": True},
],
True,
),
(
[
{"filename": "foo/test.py", "in_app": False},
{"abs_path": "/usr/local/src/foo/test.py", "in_app": True},
],
True,
),
],
)
def test_codeowners_select_in_app_frames_only(path_details, expected):
Expand Down

0 comments on commit f2f8f61

Please sign in to comment.