summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_urllib.py24
-rw-r--r--Lib/test/test_urllibnet.py10
2 files changed, 21 insertions, 13 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index 61e0202a3e..1dcbbedd70 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -640,16 +640,20 @@ class Pathname_Tests(unittest.TestCase):
def test_main():
- test_support.run_unittest(
- urlopen_FileTests,
- urlopen_HttpTests,
- urlretrieve_FileTests,
- QuotingTests,
- UnquotingTests,
- urlencode_Tests,
- Pathname_Tests,
- #FTPWrapperTests,
- )
+ import warnings
+ with test_support.catch_warning(record=False):
+ warnings.filterwarnings('ignore', ".*urllib\.urlopen.*Python 3.0",
+ DeprecationWarning)
+ test_support.run_unittest(
+ urlopen_FileTests,
+ urlopen_HttpTests,
+ urlretrieve_FileTests,
+ QuotingTests,
+ UnquotingTests,
+ urlencode_Tests,
+ Pathname_Tests,
+ #FTPWrapperTests,
+ )
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py
index 5e225ee639..0404b77ac3 100644
--- a/Lib/test/test_urllibnet.py
+++ b/Lib/test/test_urllibnet.py
@@ -182,9 +182,13 @@ class urlretrieveNetworkTests(unittest.TestCase):
def test_main():
test_support.requires('network')
- test_support.run_unittest(URLTimeoutTest,
- urlopenNetworkTests,
- urlretrieveNetworkTests)
+ from warnings import filterwarnings
+ with test_support.catch_warning(record=False):
+ filterwarnings('ignore', '.*urllib\.urlopen.*Python 3.0',
+ DeprecationWarning)
+ test_support.run_unittest(URLTimeoutTest,
+ urlopenNetworkTests,
+ urlretrieveNetworkTests)
if __name__ == "__main__":
test_main()