@@ -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 )
@@ -204,6 +213,7 @@ def test_missing_reference_stddomain(tempdir, app, status, warning):
204213 'cmd' : ('https://docs.python.org/' , inv_file ),
205214 }
206215 app .config .intersphinx_cache_limit = 0
216+ app .config .intersphinx_strict_prefix = False
207217
208218 # load the inventory and check if it's done correctly
209219 normalize_intersphinx_mapping (app , app .config )
@@ -236,6 +246,7 @@ def test_missing_reference_cppdomain(tempdir, app, status, warning):
236246 'https://docs.python.org/' : inv_file ,
237247 }
238248 app .config .intersphinx_cache_limit = 0
249+ app .config .intersphinx_strict_prefix = False
239250
240251 # load the inventory and check if it's done correctly
241252 normalize_intersphinx_mapping (app , app .config )
@@ -263,6 +274,7 @@ def test_missing_reference_jsdomain(tempdir, app, status, warning):
263274 'https://docs.python.org/' : inv_file ,
264275 }
265276 app .config .intersphinx_cache_limit = 0
277+ app .config .intersphinx_strict_prefix = False
266278
267279 # load the inventory and check if it's done correctly
268280 normalize_intersphinx_mapping (app , app .config )
@@ -289,6 +301,7 @@ def test_inventory_not_having_version(tempdir, app, status, warning):
289301 'https://docs.python.org/' : inv_file ,
290302 }
291303 app .config .intersphinx_cache_limit = 0
304+ app .config .intersphinx_strict_prefix = False
292305
293306 # load the inventory and check if it's done correctly
294307 normalize_intersphinx_mapping (app , app .config )
@@ -318,6 +331,7 @@ def test_load_mappings_warnings(tempdir, app, status, warning):
318331 }
319332
320333 app .config .intersphinx_cache_limit = 0
334+ app .config .intersphinx_strict_prefix = False
321335 # load the inventory and check if it's done correctly
322336 normalize_intersphinx_mapping (app , app .config )
323337 load_mappings (app )
@@ -328,6 +342,7 @@ def test_load_mappings_fallback(tempdir, app, status, warning):
328342 inv_file = tempdir / 'inventory'
329343 inv_file .write_bytes (inventory_v2 )
330344 app .config .intersphinx_cache_limit = 0
345+ app .config .intersphinx_strict_prefix = False
331346
332347 # connect to invalid path
333348 app .config .intersphinx_mapping = {
0 commit comments