@@ -1341,29 +1341,18 @@ def _getlines(self, lines2: Union[str, Sequence[str], Source]) -> Sequence[str]:
1341
1341
return lines2
1342
1342
1343
1343
def fnmatch_lines_random (self , lines2 : Sequence [str ]) -> None :
1344
- """Check lines exist in the output using in any order.
1345
-
1346
- Lines are checked using ``fnmatch.fnmatch``. The argument is a list of
1347
- lines which have to occur in the output, in any order.
1344
+ """Check lines exist in the output in any order (using :func:`python:fnmatch.fnmatch`).
1348
1345
"""
1349
1346
self ._match_lines_random (lines2 , fnmatch )
1350
1347
1351
1348
def re_match_lines_random (self , lines2 : Sequence [str ]) -> None :
1352
- """Check lines exist in the output using ``re.match``, in any order.
1353
-
1354
- The argument is a list of lines which have to occur in the output, in
1355
- any order.
1349
+ """Check lines exist in the output in any order (using :func:`python:re.match`).
1356
1350
"""
1357
1351
self ._match_lines_random (lines2 , lambda name , pat : bool (re .match (pat , name )))
1358
1352
1359
1353
def _match_lines_random (
1360
1354
self , lines2 : Sequence [str ], match_func : Callable [[str , str ], bool ]
1361
1355
) -> None :
1362
- """Check lines exist in the output.
1363
-
1364
- The argument is a list of lines which have to occur in the output, in
1365
- any order. Each line can contain glob whildcards.
1366
- """
1367
1356
lines2 = self ._getlines (lines2 )
1368
1357
for line in lines2 :
1369
1358
for x in self .lines :
@@ -1392,22 +1381,26 @@ def _log_text(self) -> str:
1392
1381
return "\n " .join (self ._log_output )
1393
1382
1394
1383
def fnmatch_lines (self , lines2 : Sequence [str ]) -> None :
1395
- """Search captured text for matching lines using `` fnmatch.fnmatch`` .
1384
+ """Check lines exist in the output ( using :func:`python: fnmatch.fnmatch`) .
1396
1385
1397
1386
The argument is a list of lines which have to match and can use glob
1398
1387
wildcards. If they do not match a pytest.fail() is called. The
1399
1388
matches and non-matches are also shown as part of the error message.
1389
+
1390
+ :param lines2: string patterns to match.
1400
1391
"""
1401
1392
__tracebackhide__ = True
1402
1393
self ._match_lines (lines2 , fnmatch , "fnmatch" )
1403
1394
1404
1395
def re_match_lines (self , lines2 : Sequence [str ]) -> None :
1405
- """Search captured text for matching lines using `` re.match`` .
1396
+ """Check lines exist in the output ( using :func:`python: re.match`) .
1406
1397
1407
1398
The argument is a list of lines which have to match using ``re.match``.
1408
1399
If they do not match a pytest.fail() is called.
1409
1400
1410
1401
The matches and non-matches are also shown as part of the error message.
1402
+
1403
+ :param lines2: string patterns to match.
1411
1404
"""
1412
1405
__tracebackhide__ = True
1413
1406
self ._match_lines (
0 commit comments