mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Replace catch_warnings with check_warnings when it makes sense. Use assertRaises context manager to simplify some tests.
This commit is contained in:
parent
ad59833649
commit
6257a7bbb2
21 changed files with 112 additions and 226 deletions
|
@ -182,10 +182,8 @@ class urlretrieveNetworkTests(unittest.TestCase):
|
|||
|
||||
def test_main():
|
||||
test_support.requires('network')
|
||||
from warnings import filterwarnings, catch_warnings
|
||||
with catch_warnings():
|
||||
filterwarnings('ignore', '.*urllib\.urlopen.*Python 3.0',
|
||||
DeprecationWarning)
|
||||
with test_support.check_py3k_warnings(
|
||||
("urllib.urlopen.. has been removed", DeprecationWarning)):
|
||||
test_support.run_unittest(URLTimeoutTest,
|
||||
urlopenNetworkTests,
|
||||
urlretrieveNetworkTests)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue