pylint: Use ignored-modules for pytest
See https://github.com/PyCQA/astroid/pull/357
This commit is contained in:
parent
3b6286f71a
commit
77aa8b4337
@ -68,6 +68,8 @@ max-args=10
|
||||
valid-metaclass-classmethod-first-arg=cls
|
||||
|
||||
[TYPECHECK]
|
||||
# WORKAROUND for https://github.com/PyCQA/astroid/pull/357
|
||||
ignored-modules=pytest
|
||||
# MsgType added as WORKAROUND for
|
||||
# https://bitbucket.org/logilab/pylint/issues/690/
|
||||
# UnsetObject because pylint infers any objreg.get(...) as UnsetObject.
|
||||
|
@ -53,7 +53,7 @@ def temp_git_commit_file():
|
||||
def get_build_exe_options():
|
||||
"""Get build_exe options with additional includes."""
|
||||
opts = freeze.get_build_exe_options(skip_html=True)
|
||||
opts['includes'] += pytest.freeze_includes() # pylint: disable=no-member
|
||||
opts['includes'] += pytest.freeze_includes()
|
||||
opts['includes'] += ['unittest.mock', 'PyQt5.QtTest', 'hypothesis', 'bs4',
|
||||
'httpbin', 'jinja2.ext', 'cherrypy.wsgiserver',
|
||||
'pstats']
|
||||
|
@ -430,9 +430,7 @@ def compare_session(request, quteproc, expected):
|
||||
compared.
|
||||
"""
|
||||
if request.config.getoption('--qute-bdd-webengine'):
|
||||
# pylint: disable=no-member
|
||||
pytest.xfail(reason="QtWebEngine TODO: Sessions are not implemented")
|
||||
# pylint: enable=no-member
|
||||
quteproc.compare_session(expected)
|
||||
|
||||
|
||||
@ -497,9 +495,7 @@ def check_open_tabs(quteproc, request, tabs):
|
||||
It expects a list of URLs, with an optional "(active)" suffix.
|
||||
"""
|
||||
if request.config.getoption('--qute-bdd-webengine'):
|
||||
# pylint: disable=no-member
|
||||
pytest.xfail(reason="QtWebEngine TODO: Sessions are not implemented")
|
||||
# pylint: enable=no-member
|
||||
session = quteproc.get_session()
|
||||
active_suffix = ' (active)'
|
||||
tabs = tabs.splitlines()
|
||||
@ -556,9 +552,7 @@ def _get_scroll_values(quteproc):
|
||||
r"(?P<direction>horizontally|vertically)"))
|
||||
def check_scrolled(request, quteproc, direction):
|
||||
if request.config.getoption('--qute-bdd-webengine'):
|
||||
# pylint: disable=no-member
|
||||
pytest.xfail(reason="QtWebEngine TODO: Sessions are not implemented")
|
||||
# pylint: enable=no-member
|
||||
x, y = _get_scroll_values(quteproc)
|
||||
if direction == 'horizontally':
|
||||
assert x != 0
|
||||
@ -571,9 +565,7 @@ def check_scrolled(request, quteproc, direction):
|
||||
@bdd.then("the page should not be scrolled")
|
||||
def check_not_scrolled(request, quteproc):
|
||||
if request.config.getoption('--qute-bdd-webengine'):
|
||||
# pylint: disable=no-member
|
||||
pytest.xfail(reason="QtWebEngine TODO: Sessions are not implemented")
|
||||
# pylint: enable=no-member
|
||||
x, y = _get_scroll_values(quteproc)
|
||||
assert x == 0
|
||||
assert y == 0
|
||||
|
@ -25,9 +25,7 @@ bdd.scenarios('marks.feature')
|
||||
@bdd.then(bdd.parsers.parse("the page should be scrolled to {x} {y}"))
|
||||
def check_y(request, quteproc, x, y):
|
||||
if request.config.getoption('--qute-bdd-webengine'):
|
||||
# pylint: disable=no-member
|
||||
pytest.xfail(reason="QtWebEngine TODO: Sessions are not implemented")
|
||||
# pylint: enable=no-member
|
||||
data = quteproc.get_session()
|
||||
pos = data['windows'][0]['tabs'][0]['history'][-1]['scroll-pos']
|
||||
assert int(x) == pos['x']
|
||||
|
@ -46,9 +46,6 @@ instance_counter = itertools.count()
|
||||
|
||||
def is_ignored_qt_message(message):
|
||||
"""Check if the message is listed in qt_log_ignore."""
|
||||
# pylint: disable=no-member
|
||||
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/717/
|
||||
# we should switch to generated-members after that
|
||||
regexes = pytest.config.getini('qt_log_ignore')
|
||||
for regex in regexes:
|
||||
if re.match(regex, message):
|
||||
|
@ -77,7 +77,6 @@ class Line:
|
||||
|
||||
def _render_log(data, threshold=100):
|
||||
"""Shorten the given log without -v and convert to a string."""
|
||||
# pylint: disable=no-member
|
||||
data = [str(d) for d in data]
|
||||
is_exception = any('Traceback (most recent call last):' in line
|
||||
for line in data)
|
||||
@ -109,7 +108,6 @@ def pytest_runtest_makereport(item, call):
|
||||
# actually a tuple. This is handled similarily in pytest-qt too.
|
||||
return
|
||||
|
||||
# pylint: disable=no-member
|
||||
if pytest.config.getoption('--capture') == 'no':
|
||||
# Already printed live
|
||||
return
|
||||
@ -153,7 +151,6 @@ class Process(QObject):
|
||||
|
||||
def _log(self, line):
|
||||
"""Add the given line to the captured log output."""
|
||||
# pylint: disable=no-member
|
||||
if pytest.config.getoption('--capture') == 'no':
|
||||
print(line)
|
||||
self.captured_log.append(line)
|
||||
|
@ -93,9 +93,7 @@ def test_hints(test_name, zoom_text_only, zoom_level, find_implementation,
|
||||
|
||||
parsed = _parse_file(test_name)
|
||||
if parsed.qtwebengine_todo is not None and webengine:
|
||||
# pylint: disable=no-member
|
||||
pytest.xfail("QtWebEngine TODO: {}".format(parsed.qtwebengine_todo))
|
||||
# pylint: enable=no-member
|
||||
|
||||
url_path = 'data/hints/html/{}'.format(test_name)
|
||||
quteproc.open_path(url_path)
|
||||
|
@ -49,10 +49,8 @@ def test_insert_mode(file_name, elem_id, source, input_text, auto_insert,
|
||||
quteproc.press_keys(input_text)
|
||||
elif source == 'clipboard':
|
||||
if request.config.getoption('--qute-bdd-webengine'):
|
||||
# pylint: disable=no-member
|
||||
pytest.xfail(reason="QtWebEngine TODO: :insert-text is not "
|
||||
"implemented")
|
||||
# pylint: enable=no-member
|
||||
quteproc.send_cmd(':debug-set-fake-clipboard "{}"'.format(input_text))
|
||||
quteproc.send_cmd(':insert-text {clipboard}')
|
||||
|
||||
|
@ -41,7 +41,6 @@ def test_smoke(cmd, capfd):
|
||||
if e.returncode == -signal.SIGSEGV:
|
||||
_out, err = capfd.readouterr()
|
||||
assert 'Uncaught exception' not in err
|
||||
# pylint: disable=no-member
|
||||
# https://github.com/The-Compiler/qutebrowser/issues/1387
|
||||
pytest.xfail("Ignoring segfault on exit...")
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user