Skip to content

Commit 9d096e0

Browse files
committed
Test that Traversable.{list_,}traverse, but not overrides, warn
1 parent 03464d9 commit 9d096e0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/deprecation/test_various.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import pytest
1111

1212
from git.diff import NULL_TREE
13+
from git.objects.util import Traversable
1314
from git.repo import Repo
1415

1516

@@ -68,3 +69,27 @@ def test_commit_trailers_dict_does_not_warn(commit):
6869
"""The nondeprecated Commit.trailers_dict property issues no deprecation warning."""
6970
with _assert_no_deprecation_warning():
7071
commit.trailers_dict
72+
73+
74+
def test_traverse_list_traverse_in_base_class_warns(commit):
75+
"""Traversable.list_traverse's base implementation issues a deprecation warning."""
76+
with pytest.deprecated_call():
77+
Traversable.list_traverse(commit)
78+
79+
80+
def test_traversable_list_traverse_override_does_not_warn(commit):
81+
"""Calling list_traverse on concrete subclasses is not deprecated, does not warn."""
82+
with _assert_no_deprecation_warning():
83+
commit.list_traverse()
84+
85+
86+
def test_traverse_traverse_in_base_class_warns(commit):
87+
"""Traversable.traverse's base implementation issues a deprecation warning."""
88+
with pytest.deprecated_call():
89+
Traversable.traverse(commit)
90+
91+
92+
def test_traverse_traverse_override_does_not_warn(commit):
93+
"""Calling traverse on concrete subclasses is not deprecated, does not warn."""
94+
with _assert_no_deprecation_warning():
95+
commit.traverse()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy