diff --git a/test/test_speed.py b/test/test_speed.py index dcb69840..73dda181 100644 --- a/test/test_speed.py +++ b/test/test_speed.py @@ -51,3 +51,19 @@ class TestSpeed(TestCase): with open('speed/precedence.py') as f: line = len(f.read().splitlines()) assert jedi.Script(line=line, path='speed/precedence.py').goto_definitions() + + @_check_speed(0.1) + def test_no_repr_computation(self): + """ + For Interpreter completion aquisition of sourcefile can trigger + unwanted computation of repr(). Exemple : big pandas data. + See issue #919. + """ + class Slow_repr(): + "class to test what happens if __repr__ is very slow." + def some_method(self): + pass + def __repr__(self): + time.sleep(0.2) + test = Slow_repr() + jedi.Interpreter('test.som', [locals()]).completions()