diff --git a/tests/unit/config/test_configfiles.py b/tests/unit/config/test_configfiles.py index 2b793b58b..cba7a4a7f 100644 --- a/tests/unit/config/test_configfiles.py +++ b/tests/unit/config/test_configfiles.py @@ -250,36 +250,24 @@ class TestYaml: data = autoconfig.read() assert data['content.webrtc_ip_handling_policy']['global'] == expected - @pytest.mark.parametrize('show, expected', [ - (True, 'always'), - (False, 'never'), - ('always', 'always'), - ('never', 'never'), - ('pinned', 'pinned'), + @pytest.mark.parametrize('setting, old, new', [ + ('tabs.favicons.show', True, 'always'), + ('tabs.favicons.show', False, 'never'), + ('tabs.favicons.show', 'always', 'always'), + + ('qt.force_software_rendering', True, 'software-opengl'), + ('qt.force_software_rendering', False, 'none'), + ('qt.force_software_rendering', 'chromium', 'chromium'), ]) - def test_tabs_favicons_show(self, yaml, autoconfig, show, expected): - """Tests for migration of tabs.favicons.show.""" - autoconfig.write({'tabs.favicons.show': {'global': show}}) + def test_bool_migrations(self, yaml, autoconfig, setting, old, new): + """Tests for migration of former boolean settings.""" + autoconfig.write({setting: {'global': old}}) yaml.load() yaml._save() data = autoconfig.read() - assert data['tabs.favicons.show']['global'] == expected - - @pytest.mark.parametrize('force, expected', [ - (True, 'software-opengl'), - (False, 'none'), - ('chromium', 'chromium'), - ]) - def test_force_software_rendering(self, yaml, autoconfig, force, expected): - autoconfig.write({'qt.force_software_rendering': {'global': force}}) - - yaml.load() - yaml._save() - - data = autoconfig.read() - assert data['qt.force_software_rendering']['global'] == expected + assert data[setting]['global'] == new def test_renamed_key_unknown_target(self, monkeypatch, yaml, autoconfig):