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

Appearance settings

Commit ca385a5

Browse filesBrowse files
committed
Test that subclassing deprecated git.util.Iterable warns
And that subclassing the strongly preferred git.util.Iterable class does not warn.
1 parent 21c2b72 commit ca385a5
Copy full SHA for ca385a5

File tree

1 file changed

+17
-0
lines changed
Filter options

1 file changed

+17
-0
lines changed

‎test/deprecation/test_various.py

Copy file name to clipboardExpand all lines: test/deprecation/test_various.py
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from git.diff import NULL_TREE
1313
from git.objects.util import Traversable
1414
from git.repo import Repo
15+
from git.util import Iterable as _Iterable, IterableObj
1516

1617

1718
@contextlib.contextmanager
@@ -93,3 +94,19 @@ def test_traverse_traverse_override_does_not_warn(commit):
9394
"""Calling traverse on concrete subclasses is not deprecated, does not warn."""
9495
with _assert_no_deprecation_warning():
9596
commit.traverse()
97+
98+
99+
def test_iterable_inheriting_warns():
100+
"""Subclassing the deprecated git.util.Iterable issues a deprecation warning."""
101+
with pytest.deprecated_call():
102+
103+
class Derived(_Iterable):
104+
pass
105+
106+
107+
def test_iterable_obj_inheriting_does_not_warn():
108+
"""Subclassing git.util.IterableObj is not deprecated, does not warn."""
109+
with _assert_no_deprecation_warning():
110+
111+
class Derived(IterableObj):
112+
pass

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.