Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-39983: Add test.support.print_warning() #19683

Merged
merged 1 commit into from Apr 23, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Apr 23, 2020

Log "Warning -- ..." test warnings into sys.__stderr__ rather than
sys.stderr, to ensure to display them even if sys.stderr is captured.

test.libregrtest.utils.print_warning() now calls
test.support.print_warning().

https://bugs.python.org/issue39983

Copy link
Member

@corona10 corona10 left a comment

Hmm since test_ prefix means that test something in Python,
I 'd like to suggest changing name such as just warning (support.warning)

What do you think?

Log "Warning -- ..." test warnings into sys.__stderr__ rather than
sys.stderr, to ensure to display them even if sys.stderr is captured.

test.libregrtest.utils.print_warning() now calls
test.support.print_warning().
@vstinner
Copy link
Member Author

vstinner commented Apr 23, 2020

What do you think?

I renamed the function to print_warning(). The function does what its name says: it prints a warning.

@vstinner vstinner changed the title bpo-39983: Add test.support.test_warning() bpo-39983: Add test.support.print_warning() Apr 23, 2020
Copy link
Member

@corona10 corona10 left a comment

LGTM with nit comment.

Lib/test/libregrtest/runtest.py Show resolved Hide resolved
@vstinner vstinner merged commit d663d34 into python:master Apr 23, 2020
4 checks passed
@vstinner vstinner deleted the test_warning branch Apr 23, 2020
@vstinner
Copy link
Member Author

vstinner commented Apr 23, 2020

@corona10: You was right that "test_warning()" wasn't the best name ;-) print_warning() is better.

vstinner added a commit that referenced this pull request Apr 23, 2020
Log "Warning -- ..." test warnings into sys.__stderr__ rather than
sys.stderr, to ensure to display them even if sys.stderr is captured.

test.libregrtest.utils.print_warning() now calls
test.support.print_warning().

(cherry picked from commit d663d34)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants