Skip to content

Fix TemporaryFileSwap regression where file_path could not be Path #1776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 21, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Tweak formatting for @pytest.mark.parametrize
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 #1760.
  • Loading branch information
EliahKagan committed Dec 21, 2023
commit 4e91a6c7b521dc7d0331dbb5455e9c424d26d655
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