Skip to content

Commit

Permalink
Tweak formatting for @pytest.mark.parametrize
Browse files Browse the repository at this point in the history
This removes the "fmt: off" / "fmt: on" directives around the
`@pytest.mark.parametrize` decoration on test_blob_filter, and
reformats it with black, for consistency with other such
decorations.

The style used there, *if* it could be specified as a rule and thus
used without "fmt:" directives, may be nicer than how black formats
multi-line mark decorations. However, since that decoration was
written, there have been a number of other such decorations, which
have been in black style.

This also removes the only (or only remaining?) "fmt:" directive in
the codebase. As such, it should possibly have been done in gitpython-developers#1760.
  • Loading branch information
EliahKagan committed Dec 21, 2023
1 parent b438c45 commit 4e91a6c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/test_blob_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
from git.types import PathLike


# fmt: off
@pytest.mark.parametrize('paths, path, expected_result', [
((Path("foo"),), Path("foo"), True),
((Path("foo"),), Path("foo/bar"), True),
((Path("foo/bar"),), Path("foo"), False),
((Path("foo"), Path("bar")), Path("foo"), True),
])
# fmt: on
@pytest.mark.parametrize(
"paths, path, expected_result",
[
((Path("foo"),), Path("foo"), True),
((Path("foo"),), Path("foo/bar"), True),
((Path("foo/bar"),), Path("foo"), False),
((Path("foo"), Path("bar")), Path("foo"), True),
],
)
def test_blob_filter(paths: Sequence[PathLike], path: PathLike, expected_result: bool) -> None:
"""Test the blob filter."""
blob_filter = BlobFilter(paths)
Expand Down

0 comments on commit 4e91a6c

Please sign in to comment.