Skip to content

gh-152548: Add options, env and timeout parameters to runInSubprocess() - #155163

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:test-runsubprocess-options
Open

gh-152548: Add options, env and timeout parameters to runInSubprocess()#155163
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:test-runsubprocess-options

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 4, 2026

Copy link
Copy Markdown
Member

Add three keyword-only parameters to runInSubprocess():

  • options -- interpreter command line options for the subprocess.
  • env -- environment variables, on top of the inherited environment; a value
    of None unsets a variable.
  • timeout -- how long to wait for the subprocess; the test is reported as an
    error if it does not complete in time. There is no timeout by default.

They allow converting tests that need particular interpreter flags or
environment variables to the decorator.

@read-the-docs-community

read-the-docs-community Bot commented Aug 4, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33905448 | 📁 Comparing a4bf262 against main (2b91da7)

  🔍 Preview build  

2 files changed
± library/test.html
± whatsnew/changelog.html

@serhiy-storchaka serhiy-storchaka added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Aug 4, 2026
…rocess()

They run the test subprocess with specific interpreter command line options
and environment variables, and limit how long it may take.  All are
keyword-only.  env is layered over the inherited environment; a None value
unsets a variable.  There is no timeout by default.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@serhiy-storchaka
serhiy-storchaka force-pushed the test-runsubprocess-options branch from 38ecc8d to a4bf262 Compare August 4, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant