From 0878616b2ee2d99b3240b7b5000ef0b47bb156b9 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Mon, 17 Feb 2025 22:48:00 +0000 Subject: [PATCH] [Tests] Fix stalling Console tests due to fixture mro order change The Console UI tests started stalling after the realese of pytest 7.4.3 which was a result of the reversing the mro order of fixtures on classes, to give base classes priority. The change resulted in `base_fixture` being sorted before `client` and `daemon` fixtures and the tests stalled, likely due to the use of yield in base_fixture. # pytest 7.4.2 [Mark(name='usefixtures', args=('client', 'daemon'), kwargs={})], [Mark(name='usefixtures', args=('base_fixture',), kwargs={})], # pytest 7.4.3 [Mark(name='usefixtures', args=('base_fixture',), kwargs={})], [Mark(name='usefixtures', args=('client', 'daemon'), kwargs={})], The fix is to move base_fixture along with the other fixtures and place it last. Refs: https://github.com/pytest-dev/pytest/pull/11545 --- deluge/tests/test_ui_entry.py | 4 ++-- requirements-ci.txt | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/deluge/tests/test_ui_entry.py b/deluge/tests/test_ui_entry.py index 58350079a..38b870dd2 100644 --- a/deluge/tests/test_ui_entry.py +++ b/deluge/tests/test_ui_entry.py @@ -394,8 +394,8 @@ class ConsoleUIWithDaemonBaseTestCase(UIBaseTestCase): assert std_output.endswith('Configuration value successfully updated.\n') -@pytest.mark.usefixtures('daemon', 'client') -class TestConsoleScriptEntryWithDaemon(BaseTestCase, ConsoleUIWithDaemonBaseTestCase): +@pytest.mark.usefixtures('daemon', 'client', 'base_fixture') +class TestConsoleScriptEntryWithDaemon(ConsoleUIWithDaemonBaseTestCase): @pytest.fixture(autouse=True) def set_var(self, request): request.cls.var = { diff --git a/requirements-ci.txt b/requirements-ci.txt index 0ebcd6077..34d914665 100644 --- a/requirements-ci.txt +++ b/requirements-ci.txt @@ -1,4 +1,3 @@ -r requirements.txt -r requirements-tests.txt libtorrent==2.0.7 -pytest==7.4.2