Skip to content

Commit 7f40a9f

Browse files
committed
make doc a fixture
1 parent c76c3cf commit 7f40a9f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

numpydoc/tests/test_docscrape.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@
134134
135135
'''
136136

137-
@pytest.fixture(params=['',''], ids=["flush", "newline_indented"])
137+
@pytest.fixture(params=['','\n '], ids=["flush", "newline_indented"])
138138
def doc(request):
139-
return NumpyDocString(doc_txt)
139+
return NumpyDocString(request.param+doc_txt)
140140

141141

142142
doc_firstline = NumpyDocString(doc_txt.lstrip())
@@ -180,12 +180,12 @@ def test_signature(doc):
180180
assert doc['Signature'].endswith('spam=None)')
181181

182182

183-
def test_summary():
183+
def test_summary(doc):
184184
assert doc['Summary'][0].startswith('Draw values')
185185
assert doc['Summary'][-1].endswith('covariance.')
186186

187187

188-
def test_extended_summary():
188+
def test_extended_summary(doc):
189189
assert doc['Extended Summary'][0].startswith('The multivariate normal')
190190

191191

@@ -349,23 +349,23 @@ def dummy_func(arg):
349349
or 'function dummy_func' in str(e))
350350

351351

352-
def test_notes():
352+
def test_notes(doc):
353353
assert doc['Notes'][0].startswith('Instead')
354354
assert doc['Notes'][-1].endswith('definite.')
355355
assert len(doc['Notes']) == 17
356356

357357

358-
def test_references():
358+
def test_references(doc):
359359
assert doc['References'][0].startswith('..')
360360
assert doc['References'][-1].endswith('2001.')
361361

362362

363-
def test_examples():
363+
def test_examples(doc):
364364
assert doc['Examples'][0].startswith('>>>')
365365
assert doc['Examples'][-1].endswith('True]')
366366

367367

368-
def test_index():
368+
def test_index(doc):
369369
assert doc['index']['default'] == 'random'
370370
assert len(doc['index']) == 2
371371
assert len(doc['index']['refguide']) == 2
@@ -389,7 +389,7 @@ def line_by_line_compare(a, b, n_lines=None):
389389
assert aa == bb
390390

391391

392-
def test_str():
392+
def test_str(doc):
393393
# doc_txt has the order of Notes and See Also sections flipped.
394394
# This should be handled automatically, and so, one thing this test does
395395
# is to make sure that See Also precedes Notes in the output.

0 commit comments

Comments
 (0)