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