diff --git a/AUTHORS b/AUTHORS index ceb19559e..2f50a2950 100644 --- a/AUTHORS +++ b/AUTHORS @@ -348,6 +348,7 @@ Thomas Grainger Thomas Hisch Tim Hoffmann Tim Strazny +TJ Bruno Tobias Diez Tom Dalton Tom Viner diff --git a/changelog/10597.bugfix.rst b/changelog/10597.bugfix.rst new file mode 100644 index 000000000..4ee691336 --- /dev/null +++ b/changelog/10597.bugfix.rst @@ -0,0 +1 @@ +Fix nose teardown fixture regressions. diff --git a/src/_pytest/python.py b/src/_pytest/python.py index b24a3803e..62c31b0f4 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -847,7 +847,7 @@ class Class(PyCollector): other fixtures (#517). """ setup_class = _get_first_non_fixture_func(self.obj, ("setup_class",)) - teardown_class = getattr(self.obj, "teardown_class", None) + teardown_class = _get_first_non_fixture_func(self.obj, ("teardown_class",)) if setup_class is None and teardown_class is None: return @@ -884,12 +884,12 @@ class Class(PyCollector): emit_nose_setup_warning = True setup_method = _get_first_non_fixture_func(self.obj, (setup_name,)) teardown_name = "teardown_method" - teardown_method = getattr(self.obj, teardown_name, None) + teardown_method = _get_first_non_fixture_func(self.obj, (teardown_name,)) emit_nose_teardown_warning = False if teardown_method is None and has_nose: teardown_name = "teardown" emit_nose_teardown_warning = True - teardown_method = getattr(self.obj, teardown_name, None) + teardown_method = _get_first_non_fixture_func(self.obj, (teardown_name,)) if setup_method is None and teardown_method is None: return