summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--astroid/brain/brain_pkg_resources.py1
-rw-r--r--astroid/interpreter/_import/util.py1
-rw-r--r--astroid/scoped_nodes.py2
-rw-r--r--astroid/tests/unittest_builder.py1
-rw-r--r--astroid/tests/unittest_lookup.py1
-rw-r--r--astroid/tests/unittest_manager.py8
-rw-r--r--astroid/tests/unittest_nodes.py1
7 files changed, 6 insertions, 9 deletions
diff --git a/astroid/brain/brain_pkg_resources.py b/astroid/brain/brain_pkg_resources.py
index bd60ecd3..dc54bc3e 100644
--- a/astroid/brain/brain_pkg_resources.py
+++ b/astroid/brain/brain_pkg_resources.py
@@ -65,6 +65,7 @@ def cleanup_resources(force=False):
def get_distribution(dist):
return Distribution(dist)
+_namespace_packages = {}
''')
register_module_extender(MANAGER, 'pkg_resources', pkg_resources_transform)
diff --git a/astroid/interpreter/_import/util.py b/astroid/interpreter/_import/util.py
index 79ff4e0a..3968ef9a 100644
--- a/astroid/interpreter/_import/util.py
+++ b/astroid/interpreter/_import/util.py
@@ -7,6 +7,5 @@ except ImportError:
def is_namespace(modname):
- # pylint: disable=no-member; astroid issue #290, modifying globals at runtime.
return (pkg_resources is not None
and modname in pkg_resources._namespace_packages)
diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py
index 7d313605..dabda60c 100644
--- a/astroid/scoped_nodes.py
+++ b/astroid/scoped_nodes.py
@@ -356,7 +356,7 @@ class Module(LocalsDictNodeNG):
_other_other_fields = ('locals', 'globals')
def __init__(self, name, doc, file=None,
- path: Optional[List[str]]=None,
+ path: Optional[List[str]] = None,
package=None,
parent=None, pure_python=True):
"""
diff --git a/astroid/tests/unittest_builder.py b/astroid/tests/unittest_builder.py
index f193aa9a..c4f33c94 100644
--- a/astroid/tests/unittest_builder.py
+++ b/astroid/tests/unittest_builder.py
@@ -508,7 +508,6 @@ class BuilderTest(unittest.TestCase):
'''
builder.parse(code)
nonetype = nodes.const_factory(None)
- # pylint: disable=no-member; union type in const_factory, this shouldn't happen
self.assertNotIn('custom_attr', nonetype.locals)
self.assertNotIn('custom_attr', nonetype.instance_attrs)
nonetype = nodes.const_factory({})
diff --git a/astroid/tests/unittest_lookup.py b/astroid/tests/unittest_lookup.py
index f445c1c7..6de8e7fa 100644
--- a/astroid/tests/unittest_lookup.py
+++ b/astroid/tests/unittest_lookup.py
@@ -257,7 +257,6 @@ class LookupTest(resources.SysPathSetup, unittest.TestCase):
self.assertEqual(len(intstmts), 1)
self.assertIsInstance(intstmts[0], nodes.ClassDef)
self.assertEqual(intstmts[0].name, 'int')
- # pylint: disable=no-member; union type in const_factory, this shouldn't happen
self.assertIs(intstmts[0], nodes.const_factory(1)._proxied)
def test_decorator_arguments_lookup(self):
diff --git a/astroid/tests/unittest_manager.py b/astroid/tests/unittest_manager.py
index a1e4d8db..1f351ef3 100644
--- a/astroid/tests/unittest_manager.py
+++ b/astroid/tests/unittest_manager.py
@@ -125,7 +125,7 @@ class AstroidManagerTest(resources.SysPathSetup,
def test_namespace_package_pth_support(self):
pth = 'foogle_fax-0.12.5-py2.7-nspkg.pth'
site.addpackage(resources.RESOURCE_PATH, pth, [])
- pkg_resources._namespace_packages['foogle'] = [] # pylint: disable=no-member
+ pkg_resources._namespace_packages['foogle'] = []
try:
module = self.manager.ast_from_module_name('foogle.fax')
@@ -135,7 +135,7 @@ class AstroidManagerTest(resources.SysPathSetup,
with self.assertRaises(exceptions.AstroidImportError):
self.manager.ast_from_module_name('foogle.moogle')
finally:
- del pkg_resources._namespace_packages['foogle'] # pylint: disable=no-member
+ del pkg_resources._namespace_packages['foogle']
sys.modules.pop('foogle')
def test_namespace_and_file_mismatch(self):
@@ -144,12 +144,12 @@ class AstroidManagerTest(resources.SysPathSetup,
self.assertEqual(ast.name, 'unittest')
pth = 'foogle_fax-0.12.5-py2.7-nspkg.pth'
site.addpackage(resources.RESOURCE_PATH, pth, [])
- pkg_resources._namespace_packages['foogle'] = [] # pylint: disable=no-member
+ pkg_resources._namespace_packages['foogle'] = []
try:
with self.assertRaises(exceptions.AstroidImportError):
self.manager.ast_from_module_name('unittest.foogle.fax')
finally:
- del pkg_resources._namespace_packages['foogle'] # pylint: disable=no-member
+ del pkg_resources._namespace_packages['foogle']
sys.modules.pop('foogle')
def _test_ast_from_zip(self, archive):
diff --git a/astroid/tests/unittest_nodes.py b/astroid/tests/unittest_nodes.py
index f95a68ae..6a4d68c2 100644
--- a/astroid/tests/unittest_nodes.py
+++ b/astroid/tests/unittest_nodes.py
@@ -412,7 +412,6 @@ class CmpNodeTest(unittest.TestCase):
class ConstNodeTest(unittest.TestCase):
def _test(self, value):
- # pylint: disable=no-member; union type in const_factory, this shouldn't happen
node = nodes.const_factory(value)
self.assertIsInstance(node._proxied, nodes.ClassDef)
self.assertEqual(node._proxied.name, value.__class__.__name__)