@@ -97,6 +97,7 @@ def test_missing_reference(tempdir, app, status, warning):
9797 'py3krelparent' : ('../../py3k' , inv_file ), # relative path, parent dir
9898 }
9999 app .config .intersphinx_cache_limit = 0
100+ app .config .intersphinx_strict_prefix = False
100101
101102 # load the inventory and check if it's done correctly
102103 normalize_intersphinx_mapping (app , app .config )
@@ -165,6 +166,13 @@ def test_missing_reference(tempdir, app, status, warning):
165166 rn = reference_check (app , 'std' , 'doc' , 'docname' , 'docname' )
166167 assert rn ['refuri' ] == 'https://docs.python.org/docname.html'
167168
169+ # check resolution when strict prefix is enabled
170+ app .config .intersphinx_strict_prefix = True
171+ rn = reference_check (app , 'py' , 'func' , 'module1.func' , 'foo' )
172+ assert rn is None
173+ rn = reference_check (app , 'py' , 'func' , 'py3k:module1.func' , 'foo' )
174+ assert rn is not None
175+
168176
169177def test_missing_reference_pydomain (tempdir , app , status , warning ):
170178 inv_file = tempdir / 'inventory'
@@ -173,6 +181,7 @@ def test_missing_reference_pydomain(tempdir, app, status, warning):
173181 'https://docs.python.org/' : inv_file ,
174182 }
175183 app .config .intersphinx_cache_limit = 0
184+ app .config .intersphinx_strict_prefix = False
176185
177186 # load the inventory and check if it's done correctly
178187 normalize_intersphinx_mapping (app , app .config )
@@ -212,6 +221,7 @@ def test_missing_reference_stddomain(tempdir, app, status, warning):
212221 'cmd' : ('https://docs.python.org/' , inv_file ),
213222 }
214223 app .config .intersphinx_cache_limit = 0
224+ app .config .intersphinx_strict_prefix = False
215225
216226 # load the inventory and check if it's done correctly
217227 normalize_intersphinx_mapping (app , app .config )
@@ -244,6 +254,7 @@ def test_missing_reference_cppdomain(tempdir, app, status, warning):
244254 'https://docs.python.org/' : inv_file ,
245255 }
246256 app .config .intersphinx_cache_limit = 0
257+ app .config .intersphinx_strict_prefix = False
247258
248259 # load the inventory and check if it's done correctly
249260 normalize_intersphinx_mapping (app , app .config )
@@ -271,6 +282,7 @@ def test_missing_reference_jsdomain(tempdir, app, status, warning):
271282 'https://docs.python.org/' : inv_file ,
272283 }
273284 app .config .intersphinx_cache_limit = 0
285+ app .config .intersphinx_strict_prefix = False
274286
275287 # load the inventory and check if it's done correctly
276288 normalize_intersphinx_mapping (app , app .config )
@@ -297,6 +309,7 @@ def test_inventory_not_having_version(tempdir, app, status, warning):
297309 'https://docs.python.org/' : inv_file ,
298310 }
299311 app .config .intersphinx_cache_limit = 0
312+ app .config .intersphinx_strict_prefix = False
300313
301314 # load the inventory and check if it's done correctly
302315 normalize_intersphinx_mapping (app , app .config )
@@ -326,6 +339,7 @@ def test_load_mappings_warnings(tempdir, app, status, warning):
326339 }
327340
328341 app .config .intersphinx_cache_limit = 0
342+ app .config .intersphinx_strict_prefix = False
329343 # load the inventory and check if it's done correctly
330344 normalize_intersphinx_mapping (app , app .config )
331345 load_mappings (app )
@@ -336,6 +350,7 @@ def test_load_mappings_fallback(tempdir, app, status, warning):
336350 inv_file = tempdir / 'inventory'
337351 inv_file .write_bytes (inventory_v2 )
338352 app .config .intersphinx_cache_limit = 0
353+ app .config .intersphinx_strict_prefix = False
339354
340355 # connect to invalid path
341356 app .config .intersphinx_mapping = {
0 commit comments