Skip to content

Commit 6a7ff1e

Browse files
committed
remove _classmethod_is_defined_at_leaf
1 parent ba03440 commit 6a7ff1e

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

pytest_django/plugin.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -342,33 +342,6 @@ def pytest_configure():
342342
_setup_django()
343343

344344

345-
def _classmethod_is_defined_at_leaf(cls, method_name):
346-
super_method = None
347-
348-
for base_cls in cls.__mro__[1:]: # pragma: no branch
349-
super_method = base_cls.__dict__.get(method_name)
350-
if super_method is not None:
351-
break
352-
353-
assert super_method is not None, (
354-
"%s could not be found in base classes" % method_name
355-
)
356-
357-
method = getattr(cls, method_name)
358-
359-
try:
360-
f = method.__func__
361-
except AttributeError:
362-
pytest.fail("%s.%s should be a classmethod" % (cls, method_name))
363-
if PY2 and not (
364-
inspect.ismethod(method)
365-
and inspect.isclass(method.__self__)
366-
and issubclass(cls, method.__self__)
367-
):
368-
pytest.fail("%s.%s should be a classmethod" % (cls, method_name))
369-
return f is not super_method.__func__
370-
371-
372345
def pytest_collection_modifyitems(session, config, items):
373346
def get_order_number(test):
374347
marker_db = test.get_closest_marker('django_db')

0 commit comments

Comments
 (0)