Skip to content

gh-67217: Test both warnings implementations in environment variable tests - #155234

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-67217-warnings-env-tests
Open

gh-67217: Test both warnings implementations in environment variable tests#155234
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-67217-warnings-env-tests

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

CEnvironmentVariableTests and PyEnvironmentVariableTests executed the same code in a subprocess, so they both tested the C implementation. The code executed in the subprocess now disables the C implementation when the Python implementation is tested.

Tests which only check sys.warnoptions do not depend on the used implementation: sys.warnoptions is set by the interpreter and is parsed by the same Python code in both cases. They are moved to a separate test class, are no longer duplicated, and use the runInSubprocess() decorator instead of running a source string in a subprocess.

…iable tests

The code executed in the subprocess now disables the C implementation when
the Python implementation is tested.

Tests which only check sys.warnoptions do not depend on the implementation.
They are moved to a separate test class and use the runInSubprocess()
decorator.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant