##// END OF EJS Templates
Merge pull request #10181 from Carreau/fix-5x-completion...
Thomas Kluyver -
r23218:e2984a35 merge
parent child Browse files
Show More
@@ -159,6 +159,7 b' def is_importable(module, attr, only_modules):'
159 return not(attr[:2] == '__' and attr[-2:] == '__')
159 return not(attr[:2] == '__' and attr[-2:] == '__')
160
160
161 def try_import(mod, only_modules=False):
161 def try_import(mod, only_modules=False):
162 mod = mod.rstrip('.')
162 try:
163 try:
163 m = __import__(mod)
164 m = __import__(mod)
164 except:
165 except:
@@ -780,6 +780,13 b' def test_object_key_completion():'
780 nt.assert_in('qwerty', matches)
780 nt.assert_in('qwerty', matches)
781 nt.assert_in('qwick', matches)
781 nt.assert_in('qwick', matches)
782
782
783 def test_tryimport():
784 """
785 Test that try-import don't crash on trailing dot, and import modules before
786 """
787 from IPython.core.completerlib import try_import
788 assert(try_import("IPython."))
789
783
790
784 def test_aimport_module_completer():
791 def test_aimport_module_completer():
785 ip = get_ipython()
792 ip = get_ipython()
General Comments 0
You need to be logged in to leave comments. Login now