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

Commitca385a5

Browse files
committed
Test that subclassing deprecated git.util.Iterable warns
And that subclassing the strongly preferred git.util.Iterable classdoes not warn.
1 parent21c2b72 commitca385a5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎test/deprecation/test_various.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
fromgit.diffimportNULL_TREE
1313
fromgit.objects.utilimportTraversable
1414
fromgit.repoimportRepo
15+
fromgit.utilimportIterableas_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+
deftest_iterable_inheriting_warns():
100+
"""Subclassing the deprecated git.util.Iterable issues a deprecation warning."""
101+
withpytest.deprecated_call():
102+
103+
classDerived(_Iterable):
104+
pass
105+
106+
107+
deftest_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+
classDerived(IterableObj):
112+
pass

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp