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 <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Veiko Aasa authored and Sunil Mohan Adapa committed 2024-12-05 11:38:38 -08:00
1 parent f2fad4f1cf
commit b3f82974f0
1 file changed
+2 -1
+2 -1
View File
@@ -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')