mirror of
https://github.com/python/cpython.git
synced 2025-09-11 19:27:07 +00:00
Move test.test_support.catch_warning() to the warnings module, rename it
catch_warnings(), and clean up the API. While expanding the test suite, a bug was found where a warning about the 'line' argument to showwarning() was not letting functions with '*args' go without a warning. Closes issue 3602. Code review by Benjamin Peterson.
This commit is contained in:
parent
86533776c2
commit
1eaf0742d8
11 changed files with 208 additions and 126 deletions
|
@ -67,12 +67,13 @@ Req-sent-unread-response _CS_REQ_SENT <response_class>
|
|||
"""
|
||||
|
||||
import socket
|
||||
from sys import py3kwarning
|
||||
from urlparse import urlsplit
|
||||
import warnings
|
||||
from test.test_support import catch_warning
|
||||
with catch_warning(record=False):
|
||||
warnings.filterwarnings("ignore", ".*mimetools has been removed",
|
||||
DeprecationWarning)
|
||||
with warnings.catch_warnings():
|
||||
if py3kwarning:
|
||||
warnings.filterwarnings("ignore", ".*mimetools has been removed",
|
||||
DeprecationWarning)
|
||||
import mimetools
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue