diff --git a/tests/atf_python/atf_pytest.py b/tests/atf_python/atf_pytest.py --- a/tests/atf_python/atf_pytest.py +++ b/tests/atf_python/atf_pytest.py @@ -19,12 +19,12 @@ def runtest(self): """Runs cleanup procedure for the test instead of the test itself""" instance = self.parent.cls() - cleanup_name = "cleanup_{}".format(nodeid_to_method_name(self.nodeid)) - if hasattr(instance, cleanup_name): - cleanup = getattr(instance, cleanup_name) - cleanup(self.nodeid) - elif hasattr(instance, "cleanup"): - instance.cleanup(self.nodeid) + teardown_name = "teardown_{}".format(nodeid_to_method_name(self.nodeid)) + if hasattr(instance, teardown_name): + teardown = getattr(instance, teardown_name) + teardown(self.nodeid) + elif hasattr(instance, "teardown"): + instance.teardown(self.nodeid) def setup_method_noop(self, method): """Overrides runtest setup method""" @@ -153,8 +153,8 @@ cls = self.get_test_class(obj) if cls is not None: method_name = nodeid_to_method_name(obj.nodeid) - cleanup_name = "cleanup_{}".format(method_name) - if hasattr(cls, "cleanup") or hasattr(cls, cleanup_name): + teardown_name = "teardown_{}".format(method_name) + if hasattr(cls, "teardown") or hasattr(cls, teardown_name): return True return False diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py --- a/tests/atf_python/sys/net/vnet.py +++ b/tests/atf_python/sys/net/vnet.py @@ -440,11 +440,11 @@ self.vnet_map = obj_map.vnet_map self.drop_privileges() - def cleanup(self, test_id: str): + def teardown(self, test_id: str): # pytest test id: file::class::test_name topology_id = get_topology_id(self.test_id) - print("==== vnet cleanup ===") + print("==== vnet teardown ===") print("# topology_id: '{}'".format(topology_id)) VnetFactory(topology_id).cleanup() IfaceFactory().cleanup() diff --git a/tests/examples/test_examples.py b/tests/examples/test_examples.py --- a/tests/examples/test_examples.py +++ b/tests/examples/test_examples.py @@ -79,7 +79,7 @@ def test_with_cleanup(self): print("TEST BODY") - def cleanup_test_with_cleanup(self, test_id): + def teardown_test_with_cleanup(self, test_id): print("CLEANUP HANDLER")