summaryrefslogtreecommitdiff
path: root/astroid
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-09-25 00:42:49 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2015-09-25 00:42:49 +0300
commitc110031ba03bc6172e02e274f712846a8dfad5b6 (patch)
treed613d07634ee4dbf74f9a13d935ecc90a42e1967 /astroid
parentada459dac0a79c7553a9f1c5a393049e9ce30235 (diff)
downloadastroid-c110031ba03bc6172e02e274f712846a8dfad5b6.tar.gz
Make pylint happyy.
Diffstat (limited to 'astroid')
-rw-r--r--astroid/as_string.py2
-rw-r--r--astroid/bases.py4
-rw-r--r--astroid/context.py2
-rw-r--r--astroid/rebuilder.py2
-rw-r--r--astroid/tests/unittest_inference.py38
-rw-r--r--astroid/tests/unittest_nodes.py3
6 files changed, 26 insertions, 25 deletions
diff --git a/astroid/as_string.py b/astroid/as_string.py
index ee1a143..20f4936 100644
--- a/astroid/as_string.py
+++ b/astroid/as_string.py
@@ -467,7 +467,7 @@ class AsStringVisitor3(AsStringVisitor):
def visit_await(self, node):
return 'await %s' % node.value.accept(self)
-
+
def visit_asyncwith(self, node):
return 'async %s' % self.visit_with(node)
diff --git a/astroid/bases.py b/astroid/bases.py
index 784fe9e..4378f4a 100644
--- a/astroid/bases.py
+++ b/astroid/bases.py
@@ -788,7 +788,7 @@ class NodeNG(object):
def repr_tree(self, ids=False, include_linenos=False,
ast_state=False, indent=' ', max_depth=0, max_width=80):
- """Returns a string representation of the AST from this node.
+ """Returns a string representation of the AST from this node.
:param ids: If true, includes the ids with the node type names.
@@ -820,6 +820,7 @@ class NodeNG(object):
result.extend([cur_indent + line for line in lines[1:]])
return len(lines) != 1
+ # pylint: disable=unused-variable; doesn't understand singledispatch
@_repr_tree.register(tuple)
@_repr_tree.register(list)
def _repr_seq(node, result, done, cur_indent='', depth=1):
@@ -851,6 +852,7 @@ class NodeNG(object):
result.append(']')
return broken
+ # pylint: disable=unused-variable; doesn't understand singledispatch
@_repr_tree.register(NodeNG)
def _repr_node(node, result, done, cur_indent='', depth=1):
"""Outputs a strings representation of an astroid node."""
diff --git a/astroid/context.py b/astroid/context.py
index 051fab8..ecaa1ba 100644
--- a/astroid/context.py
+++ b/astroid/context.py
@@ -66,7 +66,7 @@ class InferenceContext(object):
width=80 - len(field)))
for field in self.__slots__)
return '%s(%s)' % (type(self).__name__, ',\n '.join(state))
-
+
def __repr__(self):
state = ('%s=%s' % (field, repr(getattr(self, field)))
for field in self.__slots__)
diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py
index 29015fb..7ea9cf2 100644
--- a/astroid/rebuilder.py
+++ b/astroid/rebuilder.py
@@ -312,7 +312,7 @@ class TreeRebuilder(object):
keywords.append(new_kwargs)
else:
keywords = [new_kwargs]
-
+
newnode.postinit(self.visit(node.func, newnode, assign_ctx),
args, keywords)
return newnode
diff --git a/astroid/tests/unittest_inference.py b/astroid/tests/unittest_inference.py
index ef0886f..6af41f1 100644
--- a/astroid/tests/unittest_inference.py
+++ b/astroid/tests/unittest_inference.py
@@ -2941,27 +2941,27 @@ class InferenceTest(resources.SysPathSetup, unittest.TestCase):
def test_function_metaclasses(self):
# These are not supported right now, although
# they will be in the future.
- ast_node = test_utils.extract_node('''
- import six
+ ast_node = test_utils.extract_node('''
+ import six
- class BookMeta(type):
- author = 'Rushdie'
+ class BookMeta(type):
+ author = 'Rushdie'
- def metaclass_function(*args):
- return BookMeta
+ def metaclass_function(*args):
+ return BookMeta
- @six.add_metaclass(metaclass_function)
- class Book(object):
- pass
- Book #@
- ''')
- inferred = next(ast_node.infer())
- metaclass = inferred.metaclass()
- self.assertIsInstance(metaclass, nodes.ClassDef)
- self.assertEqual(metaclass.name, 'BookMeta')
- author = next(inferred.igetattr('author'))
- self.assertIsInstance(author, nodes.Const)
- self.assertEqual(author.value, 'Rushdie')
+ @six.add_metaclass(metaclass_function)
+ class Book(object):
+ pass
+ Book #@
+ ''')
+ inferred = next(ast_node.infer())
+ metaclass = inferred.metaclass()
+ self.assertIsInstance(metaclass, nodes.ClassDef)
+ self.assertEqual(metaclass.name, 'BookMeta')
+ author = next(inferred.igetattr('author'))
+ self.assertIsInstance(author, nodes.Const)
+ self.assertEqual(author.value, 'Rushdie')
def test_subscript_inference_error(self):
# Used to raise StopIteration
@@ -3577,7 +3577,7 @@ class SliceTest(unittest.TestCase):
''')
for node in ast_nodes:
self.assertRaises(InferenceError, next, node.infer())
-
+
if __name__ == '__main__':
unittest.main()
diff --git a/astroid/tests/unittest_nodes.py b/astroid/tests/unittest_nodes.py
index 590359e..eb21073 100644
--- a/astroid/tests/unittest_nodes.py
+++ b/astroid/tests/unittest_nodes.py
@@ -695,7 +695,7 @@ class DeprecationWarningsTest(unittest.TestCase):
@test_utils.require_version('3.5')
class Python35AsyncTest(unittest.TestCase):
-
+
def test_async_await_keywords(self):
async_def, async_for, async_with, await_node = test_utils.extract_node('''
async def func(): #@
@@ -736,7 +736,6 @@ class Python35AsyncTest(unittest.TestCase):
await 42
''')
self._test_await_async_as_string(code)
-
if __name__ == '__main__':