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 2024-12-05 12:39:40 +02:00 committed by Sunil Mohan Adapa
parent f2fad4f1cf
commit b3f82974f0
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

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')