From f306ca9b53dd72b7851650f78f158ddb1c2a36cd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 8 May 2016 11:14:42 +0200 Subject: [PATCH] Fix lint --- setup.cfg | 3 ++- tests/unit/browser/test_adblock.py | 19 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/setup.cfg b/setup.cfg index 87c41c369..0ea9576f6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,6 +31,7 @@ exclude = .venv,.hypothesis,.git,__pycache__,resources.py # (PEP257 got changed, but let's stick to the old standard) # D402: First line should not be function's signature (false-positives) # FI10 - FI15: __future__ import missing +# H101: Use TODO(NAME) # H201: bare except # H238: Use new-stule classes # H301: one import per line @@ -43,7 +44,7 @@ ignore = P101,P102,P103, D102,D103,D104,D105,D209,D211,D402, FI10,FI11,FI12,FI13,FI14,FI15, - H201,H238,H301,H306 + H101,H201,H238,H301,H306 max-complexity = 12 putty-auto-ignore = True putty-ignore = diff --git a/tests/unit/browser/test_adblock.py b/tests/unit/browser/test_adblock.py index fd33bcfd0..9b92d5b36 100644 --- a/tests/unit/browser/test_adblock.py +++ b/tests/unit/browser/test_adblock.py @@ -58,7 +58,7 @@ URLS_TO_CHECK = ('http://localhost', @pytest.fixture def data_tmpdir(monkeypatch, tmpdir): - """Set tmpdir as datadir""" + """Set tmpdir as datadir.""" tmpdir = str(tmpdir) monkeypatch.setattr('qutebrowser.utils.standarddir.data', lambda: tmpdir) @@ -139,13 +139,13 @@ def create_blocklist(directory, blocked_hosts=BLOCKLIST_HOSTS, name='hosts', line_format='one_per_line'): """Return a path to a blocklist file. - Args: - directory: path object where to create the blocklist file - blocked_hosts: an iterable of string hosts to add to the blocklist - name: name to give to the blocklist file - line_format: 'etc_hosts' --> /etc/hosts format - 'one_per_line' --> one host per line format - 'not_correct' --> Not a correct hosts file format. + Args: + directory: path object where to create the blocklist file + blocked_hosts: an iterable of string hosts to add to the blocklist + name: name to give to the blocklist file + line_format: 'etc_hosts' --> /etc/hosts format + 'one_per_line' --> one host per line format + 'not_correct' --> Not a correct hosts file format. """ blocklist_file = directory / name with open(str(blocklist_file), 'w', encoding='UTF-8') as blocklist: @@ -193,7 +193,6 @@ def generic_blocklists(directory): - a local text file with valid hosts - a remote text file without valid hosts format. """ - # remote zip file with 1 hosts file and 2 useless files file1 = create_blocklist(directory, blocked_hosts=CLEAN_HOSTS, name='README', line_format='not_correct') @@ -372,7 +371,7 @@ def test_blocking_with_whitelist(config_stub, basedir, download_stub, def test_config_change_initial(config_stub, basedir, download_stub, data_tmpdir, tmpdir): - """Test the following scenario: + """Test emptying host-block-lists on restart with existing blocked_hosts. - A blocklist is present in host-block-lists and blocked_hosts is populated - User quits qutebrowser, empties host-block-lists from his config