From 3422b21c62eb0f6de63981d5eceaaa91aaade2bc Mon Sep 17 00:00:00 2001 From: bcolsen Date: Wed, 9 Aug 2017 00:37:29 -0600 Subject: [PATCH] Added Yields test --- test/test_evaluate/test_docstring.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/test_evaluate/test_docstring.py b/test/test_evaluate/test_docstring.py index 7848c21aa..b1676ab3e 100644 --- a/test/test_evaluate/test_docstring.py +++ b/test/test_evaluate/test_docstring.py @@ -285,6 +285,28 @@ def bazbiz(): assert 'numerator' in names assert 'seed' in names +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_yields(): + s = dedent(''' + def foobar(): + """ + Yields + ---------- + x : int + y : str + """ + return x + + def bazbiz(): + z = foobar(): + z.''') + names = [c.name for c in jedi.Script(s).completions()] + print('names',names) + assert 'isupper' in names + assert 'capitalize' in names + assert 'numerator' in names + @pytest.mark.skipif(numpydoc_unavailable or numpy_unavailable, reason='numpydoc or numpy module is unavailable') def test_numpy_returns():