Merge pull request #5608 from tk0miya/refactor_test2

test: Replace call_autodoc() by do_autodoc()
This commit is contained in:
Takeshi KOMIYA
2018-11-12 00:30:36 +09:00
committed by GitHub

View File

@@ -1396,16 +1396,9 @@ def test_mocked_module_imports(app, warning):
@pytest.mark.usefixtures('setup_test')
def test_partialfunction():
def call_autodoc(objtype, name):
inst = app.registry.documenters[objtype](directive, name)
inst.generate()
result = list(directive.result)
del directive.result[:]
return result
options.members = ALL
#options.undoc_members = True
expected = [
options = {"members": None}
actual = do_autodoc(app, 'module', 'target.partialfunction', options)
assert list(actual) == [
'',
'.. py:module:: target.partialfunction',
'',
@@ -1429,8 +1422,6 @@ def test_partialfunction():
' '
]
assert call_autodoc('module', 'target.partialfunction') == expected
@pytest.mark.usefixtures('setup_test')
def test_coroutine():