Fix iter_change_type diff renamed property to prevent warning by kamilkrzyskow · Pull Request #1918 · gitpython-developers/GitPython
from git.diff import Diff from git.diff import Diff, DiffIndex from git.objects.commit import Commit
# ------------------------------------------------------------------------
@pytest.fixture def diffs(commit: "Commit") -> Generator["DiffIndex", None, None]: """Fixture to supply a DiffIndex.""" yield commit.diff(NULL_TREE)
def test_diff_renamed_warns(diff: "Diff") -> None: """The deprecated Diff.renamed property issues a deprecation warning.""" with pytest.deprecated_call():
class Derived(IterableObj): pass
def test_diff_iter_change_type(diffs: "DiffIndex") -> None: """The internal DiffIndex.iter_change_type function issues no deprecation warning.""" with assert_no_deprecation_warning():
Choose a reason for hiding this comment
The 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.