Fix lint.

This commit is contained in:
Florian Bruhin 2015-11-02 23:49:44 +01:00
parent 7da0d2b6d5
commit e13de98790
3 changed files with 25 additions and 4 deletions

View File

@ -20,7 +20,7 @@
import pytest
from helpers import utils
from helpers import utils # pylint: disable=import-error
@pytest.mark.parametrize('val1, val2', [

View File

@ -57,7 +57,7 @@ def partial_compare(val1, val2):
if val2 is Ellipsis:
print("Ignoring ellipsis comparison")
return True
elif type(val1) != type(val2):
elif type(val1) != type(val2): # pylint: disable=unidiomatic-typecheck
print("Different types ({}, {}) -> False".format(
type(val1), type(val2)))
return False

View File

@ -1,10 +1,31 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# 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 <http://www.gnu.org/licenses/>.
"""Steps for bdd-like tests."""
import re
import logging
import yaml
import pytest_bdd as bdd
from helpers import utils
from helpers import utils # pylint: disable=import-error
@bdd.given(bdd.parsers.parse("I set {sect} -> {opt} to {value}"))
@ -69,7 +90,7 @@ def compare_session(quteproc, tmpdir, expected):
# Translate ... to ellipsis in YAML.
loader = yaml.SafeLoader(expected)
loader.add_constructor('!ellipsis', lambda loader, node: ...)
loader.add_implicit_resolver('!ellipsis', re.compile('\.\.\.'), None)
loader.add_implicit_resolver('!ellipsis', re.compile(r'\.\.\.'), None)
data = yaml.load(session.read())
expected = loader.get_data()