Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork947
Fix iter_change_type diff renamed property to prevent warning#1918
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -31,7 +31,7 @@ | ||
ifTYPE_CHECKING: | ||
frompathlibimportPath | ||
fromgit.diffimportDiff,DiffIndex | ||
fromgit.objects.commitimportCommit | ||
# ------------------------------------------------------------------------ | ||
@@ -54,6 +54,12 @@ def diff(commit: "Commit") -> Generator["Diff", None, None]: | ||
yielddiff | ||
@pytest.fixture | ||
defdiffs(commit:"Commit")->Generator["DiffIndex",None,None]: | ||
"""Fixture to supply a DiffIndex.""" | ||
yieldcommit.diff(NULL_TREE) | ||
deftest_diff_renamed_warns(diff:"Diff")->None: | ||
"""The deprecated Diff.renamed property issues a deprecation warning.""" | ||
withpytest.deprecated_call(): | ||
@@ -122,3 +128,10 @@ def test_iterable_obj_inheriting_does_not_warn() -> None: | ||
classDerived(IterableObj): | ||
pass | ||
deftest_diff_iter_change_type(diffs:"DiffIndex")->None: | ||
"""The internal DiffIndex.iter_change_type function issues no deprecation warning.""" | ||
withassert_no_deprecation_warning(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. There must have been a misunderstanding. It's not about deprecation warnings, it's about adding a test that fails without the change presented here, while making clear what the issue truly is. | ||
forchange_typeindiffs.change_type: | ||
[*diffs.iter_change_type(change_type=change_type)] |
Uh oh!
There was an error while loading.Please reload this page.