From e12212942fab7aebb090ea2e631149bf2560254b Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Wed, 30 Jan 2013 01:01:25 +0100 Subject: [PATCH] Add a failing test for type inference from docstring --- test/regression.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/regression.py b/test/regression.py index 42027b8d..e818ec1a 100755 --- a/test/regression.py +++ b/test/regression.py @@ -297,6 +297,27 @@ class TestRegression(TestBase): assert c[0].word == 'IndentationError' self.assertEqual(c[0].complete, 'or') + def test_docstrings_type_str(self): + s = """ + def func(arg): + ''' + :type arg: str + ''' + arg.""" + + words = [c.word for c in self.complete(s)] + assert 'join' in words + + def test_docstrings_type_dotted_import(self): + s = """ + def func(arg): + ''' + :type arg: threading.Thread + ''' + arg.""" + words = [c.word for c in self.complete(s)] + assert 'start' in words + class TestFeature(TestBase): def test_full_name(self):