Skip to content

Commit 898028c

Browse files
remove unused _get_xunit_setup_teardown
1 parent 4480d3e commit 898028c

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/_pytest/python.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -649,27 +649,6 @@ def collect(self):
649649
pkg_prefixes.add(path)
650650

651651

652-
def _get_xunit_setup_teardown(holder, attr_name, param_obj=None):
653-
"""
654-
Return a callable to perform xunit-style setup or teardown if
655-
the function exists in the ``holder`` object.
656-
The ``param_obj`` parameter is the parameter which will be passed to the function
657-
when the callable is called without arguments, defaults to the ``holder`` object.
658-
Return ``None`` if a suitable callable is not found.
659-
"""
660-
# TODO: only needed because of Package!
661-
param_obj = param_obj if param_obj is not None else holder
662-
result = _get_non_fixture_func(holder, attr_name)
663-
if result is not None:
664-
arg_count = result.__code__.co_argcount
665-
if inspect.ismethod(result):
666-
arg_count -= 1
667-
if arg_count:
668-
return lambda: result(param_obj)
669-
else:
670-
return result
671-
672-
673652
def _call_with_optional_argument(func, arg):
674653
"""Call the given function with the given argument if func accepts one argument, otherwise
675654
calls func without arguments"""

0 commit comments

Comments
 (0)