134
134
135
135
'''
136
136
137
- @pytest .fixture (params = ['' ,'' ], ids = ["flush" , "newline_indented" ])
137
+ @pytest .fixture (params = ['' ,'\n ' ], ids = ["flush" , "newline_indented" ])
138
138
def doc (request ):
139
- return NumpyDocString (doc_txt )
139
+ return NumpyDocString (request . param + doc_txt )
140
140
141
141
142
142
doc_firstline = NumpyDocString (doc_txt .lstrip ())
@@ -180,12 +180,12 @@ def test_signature(doc):
180
180
assert doc ['Signature' ].endswith ('spam=None)' )
181
181
182
182
183
- def test_summary ():
183
+ def test_summary (doc ):
184
184
assert doc ['Summary' ][0 ].startswith ('Draw values' )
185
185
assert doc ['Summary' ][- 1 ].endswith ('covariance.' )
186
186
187
187
188
- def test_extended_summary ():
188
+ def test_extended_summary (doc ):
189
189
assert doc ['Extended Summary' ][0 ].startswith ('The multivariate normal' )
190
190
191
191
@@ -349,23 +349,23 @@ def dummy_func(arg):
349
349
or 'function dummy_func' in str (e ))
350
350
351
351
352
- def test_notes ():
352
+ def test_notes (doc ):
353
353
assert doc ['Notes' ][0 ].startswith ('Instead' )
354
354
assert doc ['Notes' ][- 1 ].endswith ('definite.' )
355
355
assert len (doc ['Notes' ]) == 17
356
356
357
357
358
- def test_references ():
358
+ def test_references (doc ):
359
359
assert doc ['References' ][0 ].startswith ('..' )
360
360
assert doc ['References' ][- 1 ].endswith ('2001.' )
361
361
362
362
363
- def test_examples ():
363
+ def test_examples (doc ):
364
364
assert doc ['Examples' ][0 ].startswith ('>>>' )
365
365
assert doc ['Examples' ][- 1 ].endswith ('True]' )
366
366
367
367
368
- def test_index ():
368
+ def test_index (doc ):
369
369
assert doc ['index' ]['default' ] == 'random'
370
370
assert len (doc ['index' ]) == 2
371
371
assert len (doc ['index' ]['refguide' ]) == 2
@@ -389,7 +389,7 @@ def line_by_line_compare(a, b, n_lines=None):
389
389
assert aa == bb
390
390
391
391
392
- def test_str ():
392
+ def test_str (doc ):
393
393
# doc_txt has the order of Notes and See Also sections flipped.
394
394
# This should be handled automatically, and so, one thing this test does
395
395
# is to make sure that See Also precedes Notes in the output.
0 commit comments