Skip to content

Commit

Permalink
Added Yields test
Browse files Browse the repository at this point in the history
  • Loading branch information
bcolsen committed Aug 9, 2017
1 parent 38a690b commit 3422b21
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_evaluate/test_docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 3422b21

Please sign in to comment.