[Python-checkins] cpython: Suppress a couple more DeprecationWarnings in the test suite.

r.david.murray python-checkins at python.org
Wed Jun 11 23:10:27 CEST 2014


http://hg.python.org/cpython/rev/38a325c84564
changeset:   91142:38a325c84564
user:        R David Murray <rdmurray at bitdance.com>
date:        Wed Jun 11 17:09:43 2014 -0400
summary:
  Suppress a couple more DeprecationWarnings in the test suite.

files:
  Lib/test/test_urllibnet.py             |  3 ++-
  Lib/unittest/test/testmock/testmock.py |  2 +-
  2 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py
--- a/Lib/test/test_urllibnet.py
+++ b/Lib/test/test_urllibnet.py
@@ -91,7 +91,8 @@
         # 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:
diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/unittest/test/testmock/testmock.py
--- a/Lib/unittest/test/testmock/testmock.py
+++ b/Lib/unittest/test/testmock/testmock.py
@@ -1211,7 +1211,7 @@
         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):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list