Skip to content

Commit 043470e

Browse files
committed
remove _classmethod_is_defined_at_leaf
1 parent 36698e3 commit 043470e

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
@@ -334,33 +334,6 @@ def pytest_configure():
334334
_setup_django()
335335

336336

337-
def _classmethod_is_defined_at_leaf(cls, method_name):
338-
super_method = None
339-
340-
for base_cls in cls.__mro__[1:]: # pragma: no branch
341-
super_method = base_cls.__dict__.get(method_name)
342-
if super_method is not None:
343-
break
344-
345-
assert super_method is not None, (
346-
"%s could not be found in base classes" % method_name
347-
)
348-
349-
method = getattr(cls, method_name)
350-
351-
try:
352-
f = method.__func__
353-
except AttributeError:
354-
pytest.fail("%s.%s should be a classmethod" % (cls, method_name))
355-
if PY2 and not (
356-
inspect.ismethod(method)
357-
and inspect.isclass(method.__self__)
358-
and issubclass(cls, method.__self__)
359-
):
360-
pytest.fail("%s.%s should be a classmethod" % (cls, method_name))
361-
return f is not super_method.__func__
362-
363-
364337
@pytest.hookimpl(tryfirst=True)
365338
def pytest_collection_modifyitems(items):
366339
def get_order_number(test):

0 commit comments

Comments
 (0)