@@ -1296,16 +1296,16 @@ def collect_by_name(
1296
1296
1297
1297
def popen (
1298
1298
self ,
1299
- cmdargs ,
1299
+ cmdargs : Sequence [ Union [ str , "os.PathLike[str]" ]] ,
1300
1300
stdout : Union [int , TextIO ] = subprocess .PIPE ,
1301
1301
stderr : Union [int , TextIO ] = subprocess .PIPE ,
1302
1302
stdin = CLOSE_STDIN ,
1303
1303
** kw ,
1304
1304
):
1305
- """Invoke subprocess.Popen.
1305
+ """Invoke :py:class:` subprocess.Popen` .
1306
1306
1307
- Calls subprocess.Popen making sure the current working directory is
1308
- in the PYTHONPATH.
1307
+ Calls :py:class:` subprocess.Popen` making sure the current working
1308
+ directory is in the `` PYTHONPATH`` .
1309
1309
1310
1310
You probably want to use :py:meth:`run` instead.
1311
1311
"""
@@ -1340,21 +1340,30 @@ def run(
1340
1340
) -> RunResult :
1341
1341
"""Run a command with arguments.
1342
1342
1343
- Run a process using subprocess.Popen saving the stdout and stderr.
1343
+ Run a process using :py:class:`subprocess.Popen` saving the stdout and
1344
+ stderr.
1344
1345
1345
1346
:param cmdargs:
1346
- The sequence of arguments to pass to `subprocess.Popen()`, with path-like objects
1347
- being converted to ``str`` automatically.
1347
+ The sequence of arguments to pass to :py:class:`subprocess.Popen`,
1348
+ with path-like objects being converted to :py:class:`str`
1349
+ automatically.
1348
1350
:param timeout:
1349
1351
The period in seconds after which to timeout and raise
1350
1352
:py:class:`Pytester.TimeoutExpired`.
1351
1353
:param stdin:
1352
- Optional standard input. Bytes are being send, closing
1353
- the pipe, otherwise it is passed through to ``popen``.
1354
- Defaults to ``CLOSE_STDIN``, which translates to using a pipe
1355
- (``subprocess.PIPE``) that gets closed.
1354
+ Optional standard input.
1356
1355
1357
- :rtype: RunResult
1356
+ - If it is :py:attr:`CLOSE_STDIN` (Default), then this method calls
1357
+ :py:class:`subprocess.Popen` with ``stdin=subprocess.PIPE``, and
1358
+ the standard input is closed immediately after the new command is
1359
+ started.
1360
+
1361
+ - If it is of type :py:class:`bytes`, these bytes are sent to the
1362
+ standard input of the command.
1363
+
1364
+ - Otherwise, it is passed through to :py:class:`subprocess.Popen`.
1365
+ For further information in this case, consult the document of the
1366
+ ``stdin`` parameter in :py:class:`subprocess.Popen`.
1358
1367
"""
1359
1368
__tracebackhide__ = True
1360
1369
0 commit comments