diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-02-21 00:55:56 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-02-21 00:55:56 (GMT) |
commit | d8bc0a369375466673d895077c0e1eb39f191f2a (patch) | |
tree | e73f035b1ed5ffd66bace10a89d88dccdaf334f5 /Lib/test/test_urllib.py | |
parent | 09d9d0f385428fb54745afc1aec21c53084a6d45 (diff) | |
parent | 79b99dba0f538a14101eefc232d44f268f2e47be (diff) | |
download | cpython-d8bc0a369375466673d895077c0e1eb39f191f2a.zip cpython-d8bc0a369375466673d895077c0e1eb39f191f2a.tar.gz cpython-d8bc0a369375466673d895077c0e1eb39f191f2a.tar.bz2 |
Merge DeprecationWarnings silencing in test_urllib from 3.3.
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r-- | Lib/test/test_urllib.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 72a0d8b..cbe4327 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -30,7 +30,10 @@ def urlopen(url, data=None, proxies=None): if proxies is not None: opener = urllib.request.FancyURLopener(proxies=proxies) elif not _urlopener: - opener = urllib.request.FancyURLopener() + with support.check_warnings( + ('FancyURLopener style of invoking requests is deprecated.', + DeprecationWarning)): + opener = urllib.request.FancyURLopener() _urlopener = opener else: opener = _urlopener @@ -1271,14 +1274,16 @@ class URLopener_Tests(unittest.TestCase): class DummyURLopener(urllib.request.URLopener): def open_spam(self, url): return url - - self.assertEqual(DummyURLopener().open( - 'spam://example/ /'),'//example/%20/') - - # test the safe characters are not quoted by urlopen - self.assertEqual(DummyURLopener().open( - "spam://c:|windows%/:=&?~#+!$,;'@()*[]|/path/"), - "//c:|windows%/:=&?~#+!$,;'@()*[]|/path/") + with support.check_warnings( + ('DummyURLopener style of invoking requests is deprecated.', + DeprecationWarning)): + self.assertEqual(DummyURLopener().open( + 'spam://example/ /'),'//example/%20/') + + # test the safe characters are not quoted by urlopen + self.assertEqual(DummyURLopener().open( + "spam://c:|windows%/:=&?~#+!$,;'@()*[]|/path/"), + "//c:|windows%/:=&?~#+!$,;'@()*[]|/path/") # Just commented them out. # Can't really tell why keep failing in windows and sparc. |