mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
changed no duplicate modules test to respect attributes with the same name as their module
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user