mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +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 interpret
|
||||
from jedi._compatibility import next, unicode
|
||||
import evaluate
|
||||
import keywords
|
||||
import evaluate
|
||||
import api_classes
|
||||
import evaluate_representation as er
|
||||
import dynamic
|
||||
|
||||
@@ -10,6 +10,7 @@ import functools
|
||||
import itertools
|
||||
import os
|
||||
import textwrap
|
||||
import inspect
|
||||
|
||||
from .base import TestBase, unittest, cwd_at
|
||||
|
||||
@@ -624,7 +625,10 @@ def test_no_duplicate_modules():
|
||||
imported = getattr(m, tm.__name__)
|
||||
except AttributeError:
|
||||
continue
|
||||
assert imported is tm
|
||||
if inspect.ismodule(imported):
|
||||
# module could have a function with the same name, e.g.
|
||||
# `keywords.keywords`.
|
||||
assert imported is tm
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user