resolve linter warnings

This commit is contained in:
Peter Rice 2016-08-15 22:43:49 -04:00
parent d4c16aa3c7
commit 67609af21b
2 changed files with 5 additions and 3 deletions

View File

@ -44,7 +44,8 @@ def incdec(url, count, inc_or_dec):
"""
segments = set(config.get('general', 'url-incdec-segments'))
try:
new_url = urlutils.incdec_number(url, inc_or_dec, count, segments=segments)
new_url = urlutils.incdec_number(url, inc_or_dec, count,
segments=segments)
except urlutils.IncDecError as error:
raise Error(error.msg)
return new_url
@ -60,7 +61,7 @@ def path_up(url, count):
path = url.path()
if not path or path == '/':
raise Error("Can't go up!")
for i in range(0, min(count, path.count('/'))):
for _i in range(0, min(count, path.count('/'))):
path = posixpath.join(path, posixpath.pardir)
url.setPath(path)
return url

View File

@ -643,7 +643,8 @@ class TestIncDecNumber:
base_url = QUrl(url.format(base_value))
expected_url = QUrl(url.format(expected_value))
new_url = urlutils.incdec_number(
base_url, incdec, count, segments={'host', 'path', 'query', 'anchor'})
base_url, incdec, count,
segments={'host', 'path', 'query', 'anchor'})
assert new_url == expected_url
@pytest.mark.parametrize('number, expected, incdec', [