diff --git a/plinth/modules/matrixsynapse/tests/test_functional.py b/plinth/modules/matrixsynapse/tests/test_functional.py index cf32770bc..4bab0c4c8 100644 --- a/plinth/modules/matrixsynapse/tests/test_functional.py +++ b/plinth/modules/matrixsynapse/tests/test_functional.py @@ -17,7 +17,8 @@ class TestMatrixSynapseApp(functional.BaseAppTests): diagnostics_delay = 1 @pytest.fixture(scope='class', autouse=True) - def fixture_setup(self, session_browser): + @classmethod + def fixture_setup(cls, session_browser): """Setup the app.""" functional.login(session_browser) functional.domain_add(session_browser, 'mydomain.example') diff --git a/plinth/modules/samba/tests/test_functional.py b/plinth/modules/samba/tests/test_functional.py index 87fe015c7..2e02bb878 100644 --- a/plinth/modules/samba/tests/test_functional.py +++ b/plinth/modules/samba/tests/test_functional.py @@ -21,7 +21,8 @@ class TestSambaApp(functional.BaseAppTests): has_web = False @pytest.fixture(scope='class', autouse=True) - def fixture_setup(self, session_browser): + @classmethod + def fixture_setup(cls, session_browser): """Setup the app.""" functional.login(session_browser) functional.networks_set_firewall_zone(session_browser, 'internal') diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index a3f21564e..e36f6af2e 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -837,12 +837,13 @@ class BaseAppTests: install(session_browser, self.app_name) @pytest.fixture(autouse=True, scope='class', name='disable_after_tests') - def fixture_disable_after_tests(self, session_browser): + @classmethod + def fixture_disable_after_tests(cls, session_browser): """Disable the app after running tests.""" yield - if self.disable_after_tests and is_installed(session_browser, - self.app_name): - app_disable(session_browser, self.app_name) + if cls.disable_after_tests and is_installed(session_browser, + cls.app_name): + app_disable(session_browser, cls.app_name) @pytest.fixture(autouse=True, name='background') def fixture_background(self, session_browser, disable_after_tests):