diff options
author | Torsten Marek <shlomme@gmail.com> | 2014-11-17 20:30:38 +0100 |
---|---|---|
committer | Torsten Marek <shlomme@gmail.com> | 2014-11-17 20:30:38 +0100 |
commit | 3eedae3887b261d4d19a207ba01fb84ac0710321 (patch) | |
tree | a737e2446fbb43758a95492b955e0280c9ba4a63 | |
parent | 3cc99c47a7b0b7b52af6051376444b252818f128 (diff) | |
download | astroid-3eedae3887b261d4d19a207ba01fb84ac0710321.tar.gz |
Clean the path importer cache correctly, do not nuke entries for the standard library.
-rw-r--r-- | astroid/tests/resources.py | 2 | ||||
-rw-r--r-- | astroid/tests/unittest_builder.py | 6 | ||||
-rw-r--r-- | tox.ini | 2 |
3 files changed, 3 insertions, 7 deletions
diff --git a/astroid/tests/resources.py b/astroid/tests/resources.py index 755b3e9..bce6547 100644 --- a/astroid/tests/resources.py +++ b/astroid/tests/resources.py @@ -42,7 +42,7 @@ class SysPathSetup(object): del sys.path[0] datadir = find('') for key in list(sys.path_importer_cache): - if key.startswith(key): + if key.startswith(datadir): del sys.path_importer_cache[key] diff --git a/astroid/tests/unittest_builder.py b/astroid/tests/unittest_builder.py index 4790bec..82f29f0 100644 --- a/astroid/tests/unittest_builder.py +++ b/astroid/tests/unittest_builder.py @@ -443,11 +443,7 @@ class BuilderTest(unittest.TestCase): next(astroid['global_no_effect'].ilookup('CSTE2')) def test_socket_build(self): - try: - import socket - except ImportError: - print(sys.path) - raise + import socket astroid = self.builder.module_build(socket) # XXX just check the first one. Actually 3 objects are inferred (look at # the socket module) but the last one as those attributes dynamically @@ -6,4 +6,4 @@ envlist = py27, py33 deps =
logilab-common
six
-commands = python -Wi -m unittest discover -v -s {envsitepackagesdir}/astroid/tests -p "unittest*.py"
+commands = python -Wi -m unittest discover -s {envsitepackagesdir}/astroid/tests -p "unittest*.py"
|