Repository: spyder-ide/spyder

Issue:
fallback_plugin tests are failing
As I was working on PR #2752, i discovered that those tests are failing. I skipped them for now in `modules_test.sh`, but they need to be fixed.

@blink1073, could you take care of that (given that you wrote them)? They should be easy to fix :-)



Discussion:

Resolving patch:
diff --git a/spyderlib/utils/introspection/fallback_plugin.py b/spyderlib/utils/introspection/fallback_plugin.py
--- a/spyderlib/utils/introspection/fallback_plugin.py
+++ b/spyderlib/utils/introspection/fallback_plugin.py
@@ -339,7 +339,7 @@ def __init__(self):
     assert '.py' in ext and '.pyx' in ext
 
     ext = all_editable_exts()
-    assert '.cfg' in ext and '.iss' in ext
+    assert '.cpp' in ext and '.html' in ext
 
     path = p.get_parent_until(os.path.abspath(__file__))
     assert path == 'spyderlib.utils.introspection.fallback_plugin'
@@ -350,8 +350,10 @@ def __init__(self):
     path = python_like_mod_finder(line, stop_token='sourcecode')
     assert path.endswith('__init__.py') and 'sourcecode' in path
 
-    path = p.get_parent_until(osp.expanduser(r'~/.spyder2/temp.py'))
-    assert path == '.spyder2.temp'
+    path = osp.expanduser(r'~/.spyder2/temp.py')
+    if os.path.exists(path):
+        path = p.get_parent_until(path)
+        assert path == '.spyder2.temp', path
 
     code = 'import re\n\nre'
     path, line = p.get_definition(CodeInfo('definition', code, len(code),
@@ -360,19 +362,19 @@ def __init__(self):
 
     code = 'self.proxy.widget; self.p'
     comp = p.get_completions(CodeInfo('completions', code, len(code)))
-    assert comp == ['proxy']
+    assert comp[0] == ('proxy', '')
 
     code = 'self.sigMessageReady.emit; self.s'
     comp = p.get_completions(CodeInfo('completions', code, len(code)))
-    assert comp == ['sigMessageReady']
+    assert comp == [('sigMessageReady', '')]
 
     code = encoding.to_unicode('álfa;á')
     comp = p.get_completions(CodeInfo('completions', code, len(code)))
-    assert comp == [encoding.to_unicode('álfa')]
+    assert comp == [(encoding.to_unicode('álfa'), '')]
 
     code = 'from numpy import one'
     comp = p.get_completions(CodeInfo('completions', code, len(code)))
-    assert 'ones' in comp
+    assert ('ones', '') in comp
 
     comp = p.get_completions(CodeInfo('completions', code, len(code),
         is_python_like=False))
@@ -380,7 +382,7 @@ def __init__(self):
 
     code = 'from numpy.testing import (asse'
     comp = p.get_completions(CodeInfo('completions', code, len(code)))
-    assert 'assert_equal' in comp
+    assert ('assert_equal', '') in comp
 
     code = '''
 def test(a, b):


Test patch:
diff --git a/continuous_integration/modules_test.sh b/continuous_integration/modules_test.sh
--- a/continuous_integration/modules_test.sh
+++ b/continuous_integration/modules_test.sh
@@ -68,10 +68,6 @@ for f in spyderlib/*/*/*.py; do
     if [[ $f == spyderlib/utils/introspection/__init__.py ]]; then
         continue
     fi
-    # TODO: fallback_plugin tests are failing!!
-    if [[ $f == spyderlib/utils/introspection/fallback_plugin.py ]]; then
-        continue
-    fi
     if [[ $f == spyderlib/widgets/externalshell/inputhooks.py ]]; then
         continue
     fi