diff options
| author | vzaborovskiy <[email protected]> | 2022-05-06 16:40:58 +0300 | 
|---|---|---|
| committer | vzaborovskiy <[email protected]> | 2022-05-06 16:40:58 +0300 | 
| commit | 0bb6ddbe6fc9120ce8eae228710de6fb8f1ccee4 (patch) | |
| tree | a7dc906242b5f23020adff2b1fa65606838365b5 /library/python/testing | |
| parent | cd04681a15e2a0f5a6c26802a5e27ab822ef5fb7 (diff) | |
Yatest added new Popen argument
ref:8ef6e980cdf596b743f677ecbfc7bca8fcf75349
Diffstat (limited to 'library/python/testing')
| -rw-r--r-- | library/python/testing/yatest_common/yatest/common/process.py | 5 | 
1 files changed, 5 insertions, 0 deletions
diff --git a/library/python/testing/yatest_common/yatest/common/process.py b/library/python/testing/yatest_common/yatest/common/process.py index b2f10f39457..5d64544f7c8 100644 --- a/library/python/testing/yatest_common/yatest/common/process.py +++ b/library/python/testing/yatest_common/yatest/common/process.py @@ -438,6 +438,7 @@ def execute(      collect_cores=True, check_sanitizer=True, preexec_fn=None, on_timeout=None,      executor=_Execution,      core_pattern=None, +    popen_kwargs=None,  ):      """      Executes a command @@ -458,6 +459,7 @@ def execute(      :param check_sanitizer: raise ExecutionError if stderr contains sanitize errors      :param preexec_fn: subrpocess.Popen preexec_fn arg      :param on_timeout: on_timeout(<execution object>, <timeout value>) callback +    :param popen_kwargs: subrpocess.Popen args dictionary. Useful for python3-only arguments      :return _Execution: Execution object      """ @@ -480,6 +482,8 @@ def execute(      if not wait and timeout is not None:          raise ValueError("Incompatible arguments 'timeout' and wait=False") +    if popen_kwargs is None: +        popen_kwargs = {}      # if subprocess.PIPE in [stdout, stderr]:      #     raise ValueError("Don't use pipe to obtain stream data - it may leads to the deadlock") @@ -542,6 +546,7 @@ def execute(          command, shell=shell, universal_newlines=True,          stdout=out_file, stderr=err_file, stdin=in_file,          cwd=cwd, env=env, creationflags=creationflags, close_fds=close_fds, preexec_fn=preexec_fn, +        **popen_kwargs      )      yatest_logger.debug("Command pid: %s", process.pid)  | 
