From 5c2d3ec96a69cf9ce11b8d1a748c63c7910405f7 Mon Sep 17 00:00:00 2001 From: Alexander Cogneau Date: Sat, 8 Aug 2015 16:46:57 +0200 Subject: [PATCH 1/9] Add a column_widths property to the base class for completion models. --- qutebrowser/completion/completionwidget.py | 15 +++++++++------ qutebrowser/completion/models/base.py | 3 +++ qutebrowser/completion/models/sortfilter.py | 1 + qutebrowser/completion/models/urlmodel.py | 2 ++ qutebrowser/config/configdata.py | 5 +++++ 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index a3bea931a..af31143c4 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -38,15 +38,13 @@ class CompletionView(QTreeView): Based on QTreeView but heavily customized so root elements show as category headers, and children show as flat list. - Class attributes: - COLUMN_WIDTHS: A list of column widths, in percent. - Attributes: enabled: Whether showing the CompletionView is enabled. _win_id: The ID of the window this CompletionView is associated with. _height: The height to use for the CompletionView. _height_perc: Either None or a percentage if height should be relative. _delegate: The item delegate used. + column_widths: A list of column widths, in percent. Signals: resize_completion: Emitted when the completion should be resized. @@ -82,7 +80,6 @@ class CompletionView(QTreeView): border: 0px; } """ - COLUMN_WIDTHS = (20, 70, 10) # FIXME style scrollbar # https://github.com/The-Compiler/qutebrowser/issues/117 @@ -103,6 +100,8 @@ class CompletionView(QTreeView): # FIXME handle new aliases. # objreg.get('config').changed.connect(self.init_command_completion) + self.column_widths = config.get('completion', + 'base-column-width-percentages') self._delegate = completiondelegate.CompletionItemDelegate(self) self.setItemDelegate(self._delegate) style.set_register_stylesheet(self) @@ -128,9 +127,9 @@ class CompletionView(QTreeView): return utils.get_repr(self) def _resize_columns(self): - """Resize the completion columns based on COLUMN_WIDTHS.""" + """Resize the completion columns based on column_widths.""" width = self.size().width() - pixel_widths = [(width * perc // 100) for perc in self.COLUMN_WIDTHS] + pixel_widths = [(width * perc // 100) for perc in self.column_widths] if self.verticalScrollBar().isVisible(): pixel_widths[-1] -= self.style().pixelMetric( QStyle.PM_ScrollBarExtent) + 5 @@ -203,6 +202,10 @@ class CompletionView(QTreeView): sel_model.deleteLater() for i in range(model.rowCount()): self.expand(model.index(i, 0)) + + if model.column_widths: + self.column_widths = model.column_widths + self._resize_columns() self.maybe_resize_completion() diff --git a/qutebrowser/completion/models/base.py b/qutebrowser/completion/models/base.py index 0d4bf7fca..9036df385 100644 --- a/qutebrowser/completion/models/base.py +++ b/qutebrowser/completion/models/base.py @@ -27,6 +27,7 @@ from PyQt5.QtCore import Qt from PyQt5.QtGui import QStandardItemModel, QStandardItem from qutebrowser.utils import usertypes, qtutils +from qutebrowser.config import config Role = usertypes.enum('Role', ['sort', 'userdata'], start=Qt.UserRole, @@ -44,6 +45,8 @@ class BaseCompletionModel(QStandardItemModel): def __init__(self, parent=None): super().__init__(parent) self.setColumnCount(3) + self.column_widths = config.get('completion', + 'base-column-width-percentages') self.columns_to_filter = [0] def new_category(self, name, sort=None): diff --git a/qutebrowser/completion/models/sortfilter.py b/qutebrowser/completion/models/sortfilter.py index 3c247a0a2..db4e8e425 100644 --- a/qutebrowser/completion/models/sortfilter.py +++ b/qutebrowser/completion/models/sortfilter.py @@ -53,6 +53,7 @@ class CompletionFilterModel(QSortFilterProxyModel): else: self.setSortRole(completion.Role.sort) self._sort_order = dumb_sort + self.column_widths = source.column_widths def set_pattern(self, val): """Setter for pattern. diff --git a/qutebrowser/completion/models/urlmodel.py b/qutebrowser/completion/models/urlmodel.py index 2da1d0b71..b33366f22 100644 --- a/qutebrowser/completion/models/urlmodel.py +++ b/qutebrowser/completion/models/urlmodel.py @@ -75,6 +75,8 @@ class UrlCompletionModel(base.BaseCompletionModel): objreg.get('config').changed.connect(self.reformat_timestamps) + self.column_widths = (40, 50, 10) + def _fmt_atime(self, atime): """Format an atime to a human-readable string.""" fmt = config.get('completion', 'timestamp-format') diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 7a1f4f236..19dd18db2 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -398,6 +398,11 @@ def data(readonly=False): "Whether to shrink the completion to be smaller than the " "configured size if there are no scrollbars."), + ('base-column-width-percentages', + SettingValue(typ.IntList(), '20,70,10'), + "List of width percentages of the base completion columns." + "These can be overridden by child classes."), + readonly=readonly )), From 36372418ca8e26df3f883ce928097a3978c962ac Mon Sep 17 00:00:00 2001 From: Alexander Cogneau Date: Sat, 8 Aug 2015 17:27:21 +0200 Subject: [PATCH 2/9] Added the default column_widths as a class attribute instead of a config option. --- qutebrowser/completion/completionwidget.py | 5 +++-- qutebrowser/completion/models/base.py | 9 ++++++--- qutebrowser/completion/models/sortfilter.py | 4 +++- qutebrowser/completion/models/urlmodel.py | 4 ++-- qutebrowser/config/configdata.py | 5 ----- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index af31143c4..28a3af116 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -28,6 +28,7 @@ from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QItemSelectionModel from qutebrowser.config import config, style from qutebrowser.completion import completiondelegate, completer +from qutebrowser.completion.models.base import BaseCompletionModel from qutebrowser.utils import qtutils, objreg, utils @@ -100,8 +101,8 @@ class CompletionView(QTreeView): # FIXME handle new aliases. # objreg.get('config').changed.connect(self.init_command_completion) - self.column_widths = config.get('completion', - 'base-column-width-percentages') + self.column_widths = BaseCompletionModel.COLUMN_WIDTHS + self._delegate = completiondelegate.CompletionItemDelegate(self) self.setItemDelegate(self._delegate) style.set_register_stylesheet(self) diff --git a/qutebrowser/completion/models/base.py b/qutebrowser/completion/models/base.py index 9036df385..1fd7e9460 100644 --- a/qutebrowser/completion/models/base.py +++ b/qutebrowser/completion/models/base.py @@ -27,7 +27,6 @@ from PyQt5.QtCore import Qt from PyQt5.QtGui import QStandardItemModel, QStandardItem from qutebrowser.utils import usertypes, qtutils -from qutebrowser.config import config Role = usertypes.enum('Role', ['sort', 'userdata'], start=Qt.UserRole, @@ -40,13 +39,17 @@ class BaseCompletionModel(QStandardItemModel): Used for showing completions later in the CompletionView. Supports setting marks and adding new categories/items easily. + + Class Attributes: + COLUMN_WIDTHS: The width percentages of the columns used in the + completion view. """ + COLUMN_WIDTHS = (20, 70, 10) + def __init__(self, parent=None): super().__init__(parent) self.setColumnCount(3) - self.column_widths = config.get('completion', - 'base-column-width-percentages') self.columns_to_filter = [0] def new_category(self, name, sort=None): diff --git a/qutebrowser/completion/models/sortfilter.py b/qutebrowser/completion/models/sortfilter.py index db4e8e425..1e8393087 100644 --- a/qutebrowser/completion/models/sortfilter.py +++ b/qutebrowser/completion/models/sortfilter.py @@ -39,6 +39,8 @@ class CompletionFilterModel(QSortFilterProxyModel): Kept as attribute because calling `sourceModel` takes quite a long time for some reason. _sort_order: The order to use for sorting if using dumb_sort. + column_widths: the width percentages of the columns in the + completion view. """ def __init__(self, source, parent=None, *, dumb_sort=None): @@ -53,7 +55,7 @@ class CompletionFilterModel(QSortFilterProxyModel): else: self.setSortRole(completion.Role.sort) self._sort_order = dumb_sort - self.column_widths = source.column_widths + self.column_widths = source.COLUMN_WIDTHS def set_pattern(self, val): """Setter for pattern. diff --git a/qutebrowser/completion/models/urlmodel.py b/qutebrowser/completion/models/urlmodel.py index b33366f22..ca1ef31fe 100644 --- a/qutebrowser/completion/models/urlmodel.py +++ b/qutebrowser/completion/models/urlmodel.py @@ -40,6 +40,8 @@ class UrlCompletionModel(base.BaseCompletionModel): TEXT_COLUMN = 1 TIME_COLUMN = 2 + COLUMN_WIDTHS = (40, 50, 10) + def __init__(self, parent=None): super().__init__(parent) @@ -75,8 +77,6 @@ class UrlCompletionModel(base.BaseCompletionModel): objreg.get('config').changed.connect(self.reformat_timestamps) - self.column_widths = (40, 50, 10) - def _fmt_atime(self, atime): """Format an atime to a human-readable string.""" fmt = config.get('completion', 'timestamp-format') diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 19dd18db2..7a1f4f236 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -398,11 +398,6 @@ def data(readonly=False): "Whether to shrink the completion to be smaller than the " "configured size if there are no scrollbars."), - ('base-column-width-percentages', - SettingValue(typ.IntList(), '20,70,10'), - "List of width percentages of the base completion columns." - "These can be overridden by child classes."), - readonly=readonly )), From 0e9f2688175d6a9371b8588f896ae450293ed2a3 Mon Sep 17 00:00:00 2001 From: Alexander Cogneau Date: Sat, 8 Aug 2015 17:47:18 +0200 Subject: [PATCH 3/9] CompletionView: - column_widths -> _column_widths - removed if-statement to verify if source model has 'column_widths'-property --- CHANGELOG.asciidoc | 2 ++ qutebrowser/completion/completionwidget.py | 10 ++++------ qutebrowser/completion/models/sortfilter.py | 3 --- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 08cd555cf..f28a594da 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -48,6 +48,8 @@ Changed mode and is not hidden anymore. - `minimal_webkit_testbrowser.py` now has a `--webengine` switch to test QtWebEngine if it's installed. +- The column width percentages for the completion view now depend on the + completion model. Fixed ~~~~~ diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index 28a3af116..cc9d21506 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -45,7 +45,7 @@ class CompletionView(QTreeView): _height: The height to use for the CompletionView. _height_perc: Either None or a percentage if height should be relative. _delegate: The item delegate used. - column_widths: A list of column widths, in percent. + _column_widths: A list of column widths, in percent. Signals: resize_completion: Emitted when the completion should be resized. @@ -101,7 +101,7 @@ class CompletionView(QTreeView): # FIXME handle new aliases. # objreg.get('config').changed.connect(self.init_command_completion) - self.column_widths = BaseCompletionModel.COLUMN_WIDTHS + self._column_widths = BaseCompletionModel.COLUMN_WIDTHS self._delegate = completiondelegate.CompletionItemDelegate(self) self.setItemDelegate(self._delegate) @@ -130,7 +130,7 @@ class CompletionView(QTreeView): def _resize_columns(self): """Resize the completion columns based on column_widths.""" width = self.size().width() - pixel_widths = [(width * perc // 100) for perc in self.column_widths] + pixel_widths = [(width * perc // 100) for perc in self._column_widths] if self.verticalScrollBar().isVisible(): pixel_widths[-1] -= self.style().pixelMetric( QStyle.PM_ScrollBarExtent) + 5 @@ -204,9 +204,7 @@ class CompletionView(QTreeView): for i in range(model.rowCount()): self.expand(model.index(i, 0)) - if model.column_widths: - self.column_widths = model.column_widths - + self._column_widths = model.source.COLUMN_WIDTHS self._resize_columns() self.maybe_resize_completion() diff --git a/qutebrowser/completion/models/sortfilter.py b/qutebrowser/completion/models/sortfilter.py index 1e8393087..3c247a0a2 100644 --- a/qutebrowser/completion/models/sortfilter.py +++ b/qutebrowser/completion/models/sortfilter.py @@ -39,8 +39,6 @@ class CompletionFilterModel(QSortFilterProxyModel): Kept as attribute because calling `sourceModel` takes quite a long time for some reason. _sort_order: The order to use for sorting if using dumb_sort. - column_widths: the width percentages of the columns in the - completion view. """ def __init__(self, source, parent=None, *, dumb_sort=None): @@ -55,7 +53,6 @@ class CompletionFilterModel(QSortFilterProxyModel): else: self.setSortRole(completion.Role.sort) self._sort_order = dumb_sort - self.column_widths = source.COLUMN_WIDTHS def set_pattern(self, val): """Setter for pattern. From f2c3cc6a3eac14010d82ddf19cc3fe5fbeb9ef53 Mon Sep 17 00:00:00 2001 From: Alexander Cogneau Date: Sat, 8 Aug 2015 17:58:12 +0200 Subject: [PATCH 4/9] Module import of completion.models instead of class. --- qutebrowser/completion/completionwidget.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index cc9d21506..27247f161 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -28,7 +28,7 @@ from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QItemSelectionModel from qutebrowser.config import config, style from qutebrowser.completion import completiondelegate, completer -from qutebrowser.completion.models.base import BaseCompletionModel +from qutebrowser.completion.models import base from qutebrowser.utils import qtutils, objreg, utils @@ -101,7 +101,7 @@ class CompletionView(QTreeView): # FIXME handle new aliases. # objreg.get('config').changed.connect(self.init_command_completion) - self._column_widths = BaseCompletionModel.COLUMN_WIDTHS + self._column_widths = base.BaseCompletionModel.COLUMN_WIDTHS self._delegate = completiondelegate.CompletionItemDelegate(self) self.setItemDelegate(self._delegate) From e29c642bc24d521600130d3c25a1cc4863a9bd20 Mon Sep 17 00:00:00 2001 From: Alexander Cogneau Date: Sat, 8 Aug 2015 18:12:51 +0200 Subject: [PATCH 5/9] Fix wrong propertyname --- qutebrowser/completion/completionwidget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index 27247f161..36de445ac 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -204,7 +204,7 @@ class CompletionView(QTreeView): for i in range(model.rowCount()): self.expand(model.index(i, 0)) - self._column_widths = model.source.COLUMN_WIDTHS + self._column_widths = model.srcmodel.COLUMN_WIDTHS self._resize_columns() self.maybe_resize_completion() From 753f87aa15fbbd5aac5b357597d408dfd748fc24 Mon Sep 17 00:00:00 2001 From: Alexander Cogneau Date: Sat, 8 Aug 2015 23:49:54 +0200 Subject: [PATCH 6/9] Default size of third column is now 0 --- qutebrowser/completion/models/base.py | 2 +- qutebrowser/completion/models/configmodel.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/qutebrowser/completion/models/base.py b/qutebrowser/completion/models/base.py index 1fd7e9460..a35c7f063 100644 --- a/qutebrowser/completion/models/base.py +++ b/qutebrowser/completion/models/base.py @@ -45,7 +45,7 @@ class BaseCompletionModel(QStandardItemModel): completion view. """ - COLUMN_WIDTHS = (20, 70, 10) + COLUMN_WIDTHS = (30, 70, 0) def __init__(self, parent=None): super().__init__(parent) diff --git a/qutebrowser/completion/models/configmodel.py b/qutebrowser/completion/models/configmodel.py index 6d39fed7b..734b68e90 100644 --- a/qutebrowser/completion/models/configmodel.py +++ b/qutebrowser/completion/models/configmodel.py @@ -28,6 +28,8 @@ from qutebrowser.completion.models import base class SettingSectionCompletionModel(base.BaseCompletionModel): + COLUMN_WIDTHS = (20, 70, 10) + """A CompletionModel filled with settings sections.""" # pylint: disable=abstract-method @@ -42,6 +44,8 @@ class SettingSectionCompletionModel(base.BaseCompletionModel): class SettingOptionCompletionModel(base.BaseCompletionModel): + COLUMN_WIDTHS = (20, 70, 10) + """A CompletionModel filled with settings and their descriptions. Attributes: @@ -95,6 +99,8 @@ class SettingOptionCompletionModel(base.BaseCompletionModel): class SettingValueCompletionModel(base.BaseCompletionModel): + COLUMN_WIDTHS = (20, 70, 10) + """A CompletionModel filled with setting values. Attributes: From 8be433f5f6830f91889a49464dd47ed8c7e01239 Mon Sep 17 00:00:00 2001 From: Alexander Cogneau Date: Tue, 11 Aug 2015 09:17:46 +0200 Subject: [PATCH 7/9] Add tests: - sum of column widths equals 100 - column widths tuple has 3 elements --- qutebrowser/completion/models/configmodel.py | 12 ++--- tests/completion/test_column_widths.py | 51 ++++++++++++++++++++ 2 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 tests/completion/test_column_widths.py diff --git a/qutebrowser/completion/models/configmodel.py b/qutebrowser/completion/models/configmodel.py index 734b68e90..0c45d817b 100644 --- a/qutebrowser/completion/models/configmodel.py +++ b/qutebrowser/completion/models/configmodel.py @@ -28,12 +28,12 @@ from qutebrowser.completion.models import base class SettingSectionCompletionModel(base.BaseCompletionModel): - COLUMN_WIDTHS = (20, 70, 10) - """A CompletionModel filled with settings sections.""" # pylint: disable=abstract-method + COLUMN_WIDTHS = (20, 70, 10) + def __init__(self, parent=None): super().__init__(parent) cat = self.new_category("Sections") @@ -44,8 +44,6 @@ class SettingSectionCompletionModel(base.BaseCompletionModel): class SettingOptionCompletionModel(base.BaseCompletionModel): - COLUMN_WIDTHS = (20, 70, 10) - """A CompletionModel filled with settings and their descriptions. Attributes: @@ -55,6 +53,8 @@ class SettingOptionCompletionModel(base.BaseCompletionModel): # pylint: disable=abstract-method + COLUMN_WIDTHS = (20, 70, 10) + def __init__(self, section, parent=None): super().__init__(parent) cat = self.new_category(section) @@ -99,8 +99,6 @@ class SettingOptionCompletionModel(base.BaseCompletionModel): class SettingValueCompletionModel(base.BaseCompletionModel): - COLUMN_WIDTHS = (20, 70, 10) - """A CompletionModel filled with setting values. Attributes: @@ -110,6 +108,8 @@ class SettingValueCompletionModel(base.BaseCompletionModel): # pylint: disable=abstract-method + COLUMN_WIDTHS = (20, 70, 10) + def __init__(self, section, option, parent=None): super().__init__(parent) self._section = section diff --git a/tests/completion/test_column_widths.py b/tests/completion/test_column_widths.py new file mode 100644 index 000000000..d67bd2247 --- /dev/null +++ b/tests/completion/test_column_widths.py @@ -0,0 +1,51 @@ +# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: + +# Copyright 2015 Alexander Cogneau +# +# This file is part of qutebrowser. +# +# qutebrowser is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# qutebrowser is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with qutebrowser. If not, see . + +"""Tests for qutebrowser.completion.models column widths""" + +from qutebrowser.completion.models.base import BaseCompletionModel +from qutebrowser.completion.models.configmodel import ( + SettingOptionCompletionModel, SettingSectionCompletionModel, + SettingValueCompletionModel) +from qutebrowser.completion.models.miscmodels import ( + CommandCompletionModel, HelpCompletionModel, QuickmarkCompletionModel, + BookmarkCompletionModel, SessionCompletionModel) +from qutebrowser.completion.models.urlmodel import UrlCompletionModel + + +class TestColumnWidths: + + """Tests for the column widths of the completion models""" + + CLASSES = [BaseCompletionModel, SettingOptionCompletionModel, + SettingOptionCompletionModel, SettingSectionCompletionModel, + SettingValueCompletionModel, CommandCompletionModel, + HelpCompletionModel, QuickmarkCompletionModel, + BookmarkCompletionModel, SessionCompletionModel, + UrlCompletionModel] + + def test_list_size(self): + """Test if there are 3 items in the COLUMN_WIDTHS property""" + for model in self.CLASSES: + assert model.COLUMN_WIDTHS.__len__() == 3 + + def test_column_width_sum(self): + """Test if the sum of the widths asserts to 100""" + for model in self.CLASSES: + assert sum(model.COLUMN_WIDTHS) == 100 From 61a6b196e99afd0d856223e3abaf3e29c7bf565a Mon Sep 17 00:00:00 2001 From: Alexander Cogneau Date: Wed, 12 Aug 2015 09:08:04 +0200 Subject: [PATCH 8/9] Parametrization for completion tests --- tests/completion/test_column_widths.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/completion/test_column_widths.py b/tests/completion/test_column_widths.py index d67bd2247..c002d4deb 100644 --- a/tests/completion/test_column_widths.py +++ b/tests/completion/test_column_widths.py @@ -19,6 +19,8 @@ """Tests for qutebrowser.completion.models column widths""" +import pytest + from qutebrowser.completion.models.base import BaseCompletionModel from qutebrowser.completion.models.configmodel import ( SettingOptionCompletionModel, SettingSectionCompletionModel, @@ -40,12 +42,16 @@ class TestColumnWidths: BookmarkCompletionModel, SessionCompletionModel, UrlCompletionModel] - def test_list_size(self): - """Test if there are 3 items in the COLUMN_WIDTHS property""" - for model in self.CLASSES: - assert model.COLUMN_WIDTHS.__len__() == 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): - def test_column_width_sum(self): """Test if the sum of the widths asserts to 100""" - for model in self.CLASSES: - assert sum(model.COLUMN_WIDTHS) == 100 + + assert sum(model.COLUMN_WIDTHS) == 100 From 5a0b16073662a7e17d43dbe50abc324b9591f40b Mon Sep 17 00:00:00 2001 From: Alexander Cogneau Date: Wed, 12 Aug 2015 11:02:41 +0200 Subject: [PATCH 9/9] Remove whitespace --- tests/completion/test_column_widths.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/completion/test_column_widths.py b/tests/completion/test_column_widths.py index c002d4deb..c9a219e78 100644 --- a/tests/completion/test_column_widths.py +++ b/tests/completion/test_column_widths.py @@ -44,14 +44,10 @@ class TestColumnWidths: @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