changed no duplicate modules test to respect attributes with the same name as their module

This commit is contained in:
David Halter
2013-08-06 13:52:25 +04:30
parent 9f843730ed
commit 1a8227aeec
2 changed files with 6 additions and 2 deletions

View File

@@ -22,8 +22,8 @@ from jedi import cache
from jedi import modules from jedi import modules
from jedi import interpret from jedi import interpret
from jedi._compatibility import next, unicode from jedi._compatibility import next, unicode
import evaluate
import keywords import keywords
import evaluate
import api_classes import api_classes
import evaluate_representation as er import evaluate_representation as er
import dynamic import dynamic

View File

@@ -10,6 +10,7 @@ import functools
import itertools import itertools
import os import os
import textwrap import textwrap
import inspect
from .base import TestBase, unittest, cwd_at from .base import TestBase, unittest, cwd_at
@@ -624,6 +625,9 @@ def test_no_duplicate_modules():
imported = getattr(m, tm.__name__) imported = getattr(m, tm.__name__)
except AttributeError: except AttributeError:
continue continue
if inspect.ismodule(imported):
# module could have a function with the same name, e.g.
# `keywords.keywords`.
assert imported is tm assert imported is tm