From: Otto Moerbeek Date: Tue, 10 Feb 2026 15:49:13 +0000 (+0100) Subject: Make sure all teardown class methods are called before raising a potential exception X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1224ddc45598d7005f0feae3168b0466e59b034c;p=thirdparty%2Fpdns.git Make sure all teardown class methods are called before raising a potential exception Signed-off-by: Otto Moerbeek --- diff --git a/regression-tests.recursor-dnssec/recursortests.py b/regression-tests.recursor-dnssec/recursortests.py index e5ca5da392..311a3ef2ce 100644 --- a/regression-tests.recursor-dnssec/recursortests.py +++ b/regression-tests.recursor-dnssec/recursortests.py @@ -780,9 +780,27 @@ distributor-threads={threads} @classmethod def tearDownClass(cls): - cls.tearDownRecursor() - cls.tearDownAuth() - cls.tearDownResponders() + rec = None + auth = None + resp = None + try: + cls.tearDownRecursor() + except BaseException as e: + rec = e + try: + cls.tearDownAuth() + except BaseException as e: + auth = e + try: + cls.tearDownResponders() + except BaseException as e: + resp = e + if rec is not None: + raise rec + if auth is not None: + raise auth + if resp is not None: + raise resp @classmethod def tearDownResponders(cls): diff --git a/regression-tests.recursor-dnssec/test_TrustAnchors.py b/regression-tests.recursor-dnssec/test_TrustAnchors.py index a8e532b322..97f95fe7b3 100644 --- a/regression-tests.recursor-dnssec/test_TrustAnchors.py +++ b/regression-tests.recursor-dnssec/test_TrustAnchors.py @@ -46,7 +46,7 @@ class TrustAnchorsDisabledTest(RecursorTest): """This test will do a query for "trustanchor.server CH TXT" and hopes to get a proper answer""" - _auth_zones = None + _auth_zones = {} _confdir = 'TrustAnchorsDisabled' _roothints = None _root_DS = None