pylint: Check attr-defined-outside-init for tests.

This commit is contained in:
Florian Bruhin 2015-12-01 22:41:16 +01:00
parent 803398c49b
commit 109984c96e
5 changed files with 8 additions and 3 deletions

View File

@ -49,7 +49,6 @@ def main():
files.append(os.path.join(dirpath, fn))
disabled = [
'attribute-defined-outside-init',
'redefined-outer-name',
'unused-argument',
'missing-docstring',

View File

@ -71,7 +71,9 @@ def fake_statusbar(qtbot):
vbox.addStretch()
statusbar = FakeStatusBar(container)
statusbar.container = container # to make sure container isn't GCed
# to make sure container isn't GCed
# pylint: disable=attribute-defined-outside-init
statusbar.container = container
vbox.addWidget(statusbar)
container.show()

View File

@ -38,6 +38,7 @@ class HTTPGetStub(httpclient.HTTPClient):
def __init__(self, success=True, json=None):
super().__init__()
self.url = None
self._success = success
if json:
self._json = json

View File

@ -933,6 +933,8 @@ class TestEventLoop:
loop: The EventLoop we're testing.
"""
# pylint: disable=attribute-defined-outside-init
def _assert_executing(self):
"""Slot which gets called from timers to be sure the loop runs."""
assert self.loop._executing

View File

@ -47,7 +47,8 @@ class FakeDNS:
FakeDNSAnswer = collections.namedtuple('FakeDNSAnswer', ['error'])
def __init__(self):
self.reset()
self.used = False
self.answer = None
def __repr__(self):
return utils.get_repr(self, used=self.used, answer=self.answer)