File tree 2 files changed +3
-5
lines changed
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -394,12 +394,8 @@ def _parse(self):
394
394
sections = list (self ._read_sections ())
395
395
section_names = {section for section , content in sections }
396
396
397
- has_returns = "Returns" in section_names
398
397
has_yields = "Yields" in section_names
399
398
# We could do more tests, but we are not. Arbitrarily.
400
- if has_returns and has_yields :
401
- msg = "Docstring contains both a Returns and Yields section."
402
- raise ValueError (msg )
403
399
if not has_yields and "Receives" in section_names :
404
400
msg = "Docstring contains a Receives section but not Yields."
405
401
raise ValueError (msg )
Original file line number Diff line number Diff line change @@ -279,7 +279,9 @@ def test_returnyield():
279
279
The number of bananas.
280
280
281
281
"""
282
- assert_raises (ValueError , NumpyDocString , doc_text )
282
+ doc = NumpyDocString (doc_text )
283
+ assert len (doc ['Returns' ]) == 1
284
+ assert len (doc ['Yields' ]) == 2
283
285
284
286
285
287
def test_section_twice ():
You can’t perform that action at this time.
0 commit comments