From 1a8227aeec34b08d58e495b24ddde90a333ecabe Mon Sep 17 00:00:00 2001 From: David Halter Date: Tue, 6 Aug 2013 13:52:25 +0430 Subject: [PATCH] changed no duplicate modules test to respect attributes with the same name as their module --- jedi/api.py | 2 +- test/test_regression.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jedi/api.py b/jedi/api.py index 90e4b934..73b60421 100644 --- a/jedi/api.py +++ b/jedi/api.py @@ -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 diff --git a/test/test_regression.py b/test/test_regression.py index 71d92c43..f31e3d29 100755 --- a/test/test_regression.py +++ b/test/test_regression.py @@ -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__':