From adc428e5252af98a8364ffb76100e3633b354271 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Sat, 6 Aug 2016 20:48:21 -0400 Subject: [PATCH] Perfect coverage for sortfilter. Mark an area of sortfilter with `#pragma no coverage` and add it to perfect_files. --- qutebrowser/completion/models/sortfilter.py | 4 ++-- scripts/dev/check_coverage.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qutebrowser/completion/models/sortfilter.py b/qutebrowser/completion/models/sortfilter.py index ffa44b82e..56905bbec 100644 --- a/qutebrowser/completion/models/sortfilter.py +++ b/qutebrowser/completion/models/sortfilter.py @@ -135,8 +135,8 @@ class CompletionFilterModel(QSortFilterProxyModel): for col in self.srcmodel.columns_to_filter: idx = self.srcmodel.index(row, col, parent) - if not idx.isValid(): - # No entries in parent model + if not idx.isValid(): # pragma: no cover + # this is a sanity check not hit by any test case continue data = self.srcmodel.data(idx) if not data: diff --git a/scripts/dev/check_coverage.py b/scripts/dev/check_coverage.py index 457f472ba..6d42e76cf 100644 --- a/scripts/dev/check_coverage.py +++ b/scripts/dev/check_coverage.py @@ -150,6 +150,8 @@ PERFECT_FILES = [ ('tests/unit/completion/test_models.py', 'qutebrowser/completion/models/base.py'), + ('tests/unit/completion/test_sortfilter.py', + 'qutebrowser/completion/models/sortfilter.py'), ]