Fix #3351: intersphinx does not refers context

This commit is contained in:
Takeshi KOMIYA
2017-01-30 01:16:10 +09:00
parent 9fd0205b27
commit b39b0191a7
6 changed files with 69 additions and 2 deletions

View File

@@ -145,6 +145,18 @@ def test_missing_reference(tempdir, app, status, warning):
assert rn is None
assert contnode[0].astext() == 'py3k:unknown'
# no context data
kwargs = {}
node, contnode = fake_node('py', 'func', 'func', 'func()', **kwargs)
rn = missing_reference(app, app.env, node, contnode)
assert rn is None
# context data (like py:module) help to search objects
kwargs = {'py:module': 'module1'}
node, contnode = fake_node('py', 'func', 'func', 'func()', **kwargs)
rn = missing_reference(app, app.env, node, contnode)
assert rn[0].astext() == 'func()'
# check relative paths
rn = reference_check('py', 'mod', 'py3krel:module1', 'foo')
assert rn['refuri'] == 'py3k/foo.html#module-module1'