Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd597088

Browse files
committed
Add deprecation test for DiffIndex.iter_change_type
1 parentca1d031 commitd597088

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎test/deprecation/test_basic.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
ifTYPE_CHECKING:
3232
frompathlibimportPath
3333

34-
fromgit.diffimportDiff
34+
fromgit.diffimportDiff,DiffIndex
3535
fromgit.objects.commitimportCommit
3636

3737
# ------------------------------------------------------------------------
@@ -54,6 +54,12 @@ def diff(commit: "Commit") -> Generator["Diff", None, None]:
5454
yielddiff
5555

5656

57+
@pytest.fixture
58+
defdiffs(commit:"Commit")->Generator["DiffIndex",None,None]:
59+
"""Fixture to supply a DiffIndex."""
60+
yieldcommit.diff(NULL_TREE)
61+
62+
5763
deftest_diff_renamed_warns(diff:"Diff")->None:
5864
"""The deprecated Diff.renamed property issues a deprecation warning."""
5965
withpytest.deprecated_call():
@@ -122,3 +128,10 @@ def test_iterable_obj_inheriting_does_not_warn() -> None:
122128

123129
classDerived(IterableObj):
124130
pass
131+
132+
133+
deftest_diff_iter_change_type(diffs:"DiffIndex")->None:
134+
"""The internal DiffIndex.iter_change_type function issues no deprecation warning."""
135+
withassert_no_deprecation_warning():
136+
forchange_typeindiffs.change_type:
137+
[*diffs.iter_change_type(change_type=change_type)]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp