@@ -1268,14 +1268,100 @@ def typehints_use_signature(a: AsyncGenerator) -> AsyncGenerator:
1268
1268
return a
1269
1269
1270
1270
1271
+ prolog = """
1272
+ .. |test_node_start| replace:: {test_node_start}
1273
+ """ .format (test_node_start = "test_start" )
1274
+
1275
+
1276
+ @expected (
1277
+ """
1278
+ mod.docstring_with_multiline_note_after_params_prolog_replace(param)
1279
+
1280
+ Do something.
1281
+
1282
+ Parameters:
1283
+ **param** ("int") -- A parameter.
1284
+
1285
+ Return type:
1286
+ "None"
1287
+
1288
+ Note:
1289
+
1290
+ Some notes. test_start More notes
1291
+
1292
+ """ ,
1293
+ rst_prolog = prolog ,
1294
+ )
1295
+ def docstring_with_multiline_note_after_params_prolog_replace (param : int ) -> None : # noqa: ARG001
1296
+ """Do something.
1297
+
1298
+ Args:
1299
+ param: A parameter.
1300
+
1301
+ Note:
1302
+
1303
+ Some notes. |test_node_start|
1304
+ More notes
1305
+ """
1306
+
1307
+
1308
+ epilog = """
1309
+ .. |test_node_end| replace:: {test_node_end}
1310
+ """ .format (test_node_end = "test_end" )
1311
+
1312
+
1313
+ @expected (
1314
+ """
1315
+ mod.docstring_with_multiline_note_after_params_epilog_replace(param)
1316
+
1317
+ Do something.
1318
+
1319
+ Parameters:
1320
+ **param** ("int") -- A parameter.
1321
+
1322
+ Return type:
1323
+ "None"
1324
+
1325
+ Note:
1326
+
1327
+ Some notes. test_end More notes
1328
+
1329
+ """ ,
1330
+ rst_epilog = epilog ,
1331
+ )
1332
+ def docstring_with_multiline_note_after_params_epilog_replace (param : int ) -> None : # noqa: ARG001
1333
+ """Do something.
1334
+
1335
+ Args:
1336
+ param: A parameter.
1337
+
1338
+ Note:
1339
+
1340
+ Some notes. |test_node_end|
1341
+ More notes
1342
+ """
1343
+
1344
+
1345
+ # Config settings for each test run.
1346
+ # Config Name: Sphinx Options as Dict.
1347
+ configs = {
1348
+ "default_conf" : {},
1349
+ "prolog_conf" : {"rst_prolog" : prolog },
1350
+ "epilog_conf" : {
1351
+ "rst_epilog" : epilog ,
1352
+ },
1353
+ "bothlog_conf" : {
1354
+ "rst_prolog" : prolog ,
1355
+ "rst_epilog" : epilog ,
1356
+ },
1357
+ }
1358
+
1359
+
1271
1360
@pytest .mark .parametrize ("val" , [x for x in globals ().values () if hasattr (x , "EXPECTED" )])
1361
+ @pytest .mark .parametrize ("conf_run" , ["default_conf" , "prolog_conf" , "epilog_conf" , "bothlog_conf" ])
1272
1362
@pytest .mark .sphinx ("text" , testroot = "integration" )
1273
1363
def test_integration (
1274
- app : SphinxTestApp ,
1275
- status : StringIO ,
1276
- warning : StringIO ,
1277
- monkeypatch : pytest .MonkeyPatch ,
1278
- val : Any ,
1364
+ app : SphinxTestApp , status : StringIO , warning : StringIO , monkeypatch : pytest .MonkeyPatch , val : Any , conf_run : str
1279
1365
) -> None :
1280
1366
if isclass (val ) and issubclass (val , BaseException ):
1281
1367
template = AUTO_EXCEPTION
@@ -1285,6 +1371,7 @@ def test_integration(
1285
1371
template = AUTO_FUNCTION
1286
1372
1287
1373
(Path (app .srcdir ) / "index.rst" ).write_text (template .format (val .__name__ ))
1374
+ app .config .__dict__ .update (configs [conf_run ])
1288
1375
app .config .__dict__ .update (val .OPTIONS )
1289
1376
monkeypatch .setitem (sys .modules , "mod" , sys .modules [__name__ ])
1290
1377
app .build ()
0 commit comments