Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

Merged
merged 1 commit into from
Apr 23, 2020
Merged

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nit comment.

@vstinner vstinner merged commit d663d34 into python:master Apr 23, 2020
@vstinner vstinner deleted the test_warning branch April 23, 2020 17:03
@vstinner
Copy link
Member Author

@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.

4 participants