]> granicus.if.org Git - python/commitdiff
Suppress a couple more DeprecationWarnings in the test suite.
authorR David Murray <rdmurray@bitdance.com>
Wed, 11 Jun 2014 21:09:43 +0000 (17:09 -0400)
committerR David Murray <rdmurray@bitdance.com>
Wed, 11 Jun 2014 21:09:43 +0000 (17:09 -0400)
Lib/test/test_urllibnet.py
Lib/unittest/test/testmock/testmock.py

index 4c8ba2d22c3de281af38c8d954922f20ae52a9ad..42ebb6e60b5e83eb31a4c4469019ca10064fcb46 100644 (file)
@@ -91,7 +91,8 @@ class urlopenNetworkTests(unittest.TestCase):
         # test getcode() with the fancy opener to get 404 error codes
         URL = "http://www.example.com/XXXinvalidXXX"
         with support.transient_internet(URL):
-            open_url = urllib.request.FancyURLopener().open(URL)
+            with self.assertWarns(DeprecationWarning):
+                open_url = urllib.request.FancyURLopener().open(URL)
             try:
                 code = open_url.getcode()
             finally:
index 7019ee901217f93346765a3ef20d710d5109f7cc..a5499732c22a526c295aab55e027f4166ea31a5c 100644 (file)
@@ -1211,7 +1211,7 @@ class MockTest(unittest.TestCase):
         m = Mock()
         m.hello(name='hello', daddy='hero')
         text = "call(daddy='hero', name='hello')"
-        self.assertEquals(repr(m.hello.call_args), text)
+        self.assertEqual(repr(m.hello.call_args), text)
 
     def test_mock_add_spec(self):
         class _One(object):