From cfbd02eabaceb6a66a35629cb321af09270eec4b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 20 Aug 2016 22:07:57 +0200 Subject: [PATCH] tests: Clean up test_column_widths --- tests/unit/completion/test_column_widths.py | 29 +++++++++------------ 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/tests/unit/completion/test_column_widths.py b/tests/unit/completion/test_column_widths.py index d138e996b..aae9c71aa 100644 --- a/tests/unit/completion/test_column_widths.py +++ b/tests/unit/completion/test_column_widths.py @@ -31,23 +31,20 @@ from qutebrowser.completion.models.miscmodels import ( from qutebrowser.completion.models.urlmodel import UrlCompletionModel -class TestColumnWidths: +CLASSES = [BaseCompletionModel, SettingOptionCompletionModel, + SettingOptionCompletionModel, SettingSectionCompletionModel, + SettingValueCompletionModel, CommandCompletionModel, + HelpCompletionModel, QuickmarkCompletionModel, + BookmarkCompletionModel, SessionCompletionModel, UrlCompletionModel] - """Tests for the column widths of the completion models.""" - CLASSES = [BaseCompletionModel, SettingOptionCompletionModel, - SettingOptionCompletionModel, SettingSectionCompletionModel, - SettingValueCompletionModel, CommandCompletionModel, - HelpCompletionModel, QuickmarkCompletionModel, - BookmarkCompletionModel, SessionCompletionModel, - UrlCompletionModel] +@pytest.mark.parametrize("model", CLASSES) +def test_list_size(model): + """Test if there are 3 items in the COLUMN_WIDTHS property.""" + assert len(model.COLUMN_WIDTHS) == 3 - @pytest.mark.parametrize("model", CLASSES) - def test_list_size(self, model): - """Test if there are 3 items in the COLUMN_WIDTHS property.""" - assert len(model.COLUMN_WIDTHS) == 3 - @pytest.mark.parametrize("model", CLASSES) - def test_column_width_sum(self, model): - """Test if the sum of the widths asserts to 100.""" - assert sum(model.COLUMN_WIDTHS) == 100 +@pytest.mark.parametrize("model", CLASSES) +def test_column_width_sum(model): + """Test if the sum of the widths asserts to 100.""" + assert sum(model.COLUMN_WIDTHS) == 100