From b3f82974f08056edf6f9d9d974a33237c802e375 Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Thu, 5 Dec 2024 12:39:40 +0200 Subject: [PATCH] tests: functional: Don't try disable app after tests if app was not installed Fixes an issue where app tests teardown fails if app installation fails or app is not available for distribution. Tests: - On Debian Bookworm, all miniflux functional tests are skipped and there are no errors. - After running gitweb metadata functional test, the app is disabled. Signed-off-by: Veiko Aasa Reviewed-by: Sunil Mohan Adapa --- plinth/tests/functional/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index 7b109b9d8..9a5b6394f 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -763,7 +763,8 @@ class BaseAppTests: def fixture_disable_after_tests(self, session_browser): """Disable the app after running tests.""" yield - if self.disable_after_tests: + if self.disable_after_tests and is_installed(session_browser, + self.app_name): app_disable(session_browser, self.app_name) @pytest.fixture(autouse=True, name='background')