Skip to content

Commit fffa6ce

Browse files
committed
Test that the preferred renamed_file property does not warn
1 parent a8f109c commit fffa6ce

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: test/deprecation/test_various.py

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""Tests of assorted deprecation warnings with no extra subtleties to check."""
55

66
import gc
7+
import warnings
78

89
import pytest
910

@@ -25,5 +26,14 @@ def single_diff(tmp_path):
2526

2627

2728
def test_diff_renamed_warns(single_diff):
29+
"""The deprecated Diff.renamed property issues a deprecation warning."""
2830
with pytest.deprecated_call():
2931
single_diff.renamed
32+
33+
34+
def test_diff_renamed_file_does_not_warn(single_diff):
35+
"""The preferred Diff.renamed_file property issues no deprecation warning."""
36+
with warnings.catch_warnings():
37+
# FIXME: Refine this to filter for deprecation warnings from GitPython.
38+
warnings.simplefilter("error", DeprecationWarning)
39+
single_diff.renamed_file

0 commit comments

Comments
 (0)