[Python-checkins] r87783 - in python/branches/py3k/Lib/test: datetimetester.py test_httplib.py test_threading.py test_winreg.py

raymond.hettinger python-checkins at python.org
Thu Jan 6 06:34:18 CET 2011


Author: raymond.hettinger
Date: Thu Jan  6 06:34:17 2011
New Revision: 87783

Log:
Issue 10825: Minor updates to the test suite.

Modified:
   python/branches/py3k/Lib/test/datetimetester.py
   python/branches/py3k/Lib/test/test_httplib.py
   python/branches/py3k/Lib/test/test_threading.py
   python/branches/py3k/Lib/test/test_winreg.py

Modified: python/branches/py3k/Lib/test/datetimetester.py
==============================================================================
--- python/branches/py3k/Lib/test/datetimetester.py	(original)
+++ python/branches/py3k/Lib/test/datetimetester.py	Thu Jan  6 06:34:17 2011
@@ -202,7 +202,7 @@
 
 
     def test_dst(self):
-        self.assertEqual(None, timezone.utc.dst(self.DT))
+        self.assertIsNone(timezone.utc.dst(self.DT))
 
         with self.assertRaises(TypeError): self.EST.dst('')
         with self.assertRaises(TypeError): self.EST.dst(5)

Modified: python/branches/py3k/Lib/test/test_httplib.py
==============================================================================
--- python/branches/py3k/Lib/test/test_httplib.py	(original)
+++ python/branches/py3k/Lib/test/test_httplib.py	Thu Jan  6 06:34:17 2011
@@ -560,7 +560,7 @@
         self.conn.request("PUT", "/url", "body")
         message, f = self.get_headers_and_fp()
         self.assertEqual("text/plain", message.get_content_type())
-        self.assertEqual(None, message.get_charset())
+        self.assertIsNone(message.get_charset())
         self.assertEqual("4", message.get("content-length"))
         self.assertEqual(b'body', f.read())
 
@@ -568,7 +568,7 @@
         self.conn.request("PUT", "/url", "body\xc1")
         message, f = self.get_headers_and_fp()
         self.assertEqual("text/plain", message.get_content_type())
-        self.assertEqual(None, message.get_charset())
+        self.assertIsNone(message.get_charset())
         self.assertEqual("5", message.get("content-length"))
         self.assertEqual(b'body\xc1', f.read())
 
@@ -576,7 +576,7 @@
         self.conn.request("PUT", "/url", b"body\xc1")
         message, f = self.get_headers_and_fp()
         self.assertEqual("text/plain", message.get_content_type())
-        self.assertEqual(None, message.get_charset())
+        self.assertIsNone(message.get_charset())
         self.assertEqual("5", message.get("content-length"))
         self.assertEqual(b'body\xc1', f.read())
 
@@ -587,7 +587,7 @@
             self.conn.request("PUT", "/url", f)
             message, f = self.get_headers_and_fp()
             self.assertEqual("text/plain", message.get_content_type())
-            self.assertEqual(None, message.get_charset())
+            self.assertIsNone(message.get_charset())
             self.assertEqual("4", message.get("content-length"))
             self.assertEqual(b'body', f.read())
 
@@ -598,7 +598,7 @@
             self.conn.request("PUT", "/url", f)
             message, f = self.get_headers_and_fp()
             self.assertEqual("text/plain", message.get_content_type())
-            self.assertEqual(None, message.get_charset())
+            self.assertIsNone(message.get_charset())
             self.assertEqual("5", message.get("content-length"))
             self.assertEqual(b'body\xc1', f.read())
 

Modified: python/branches/py3k/Lib/test/test_threading.py
==============================================================================
--- python/branches/py3k/Lib/test/test_threading.py	(original)
+++ python/branches/py3k/Lib/test/test_threading.py	Thu Jan  6 06:34:17 2011
@@ -396,7 +396,7 @@
         weak_cyclic_object = weakref.ref(cyclic_object)
         cyclic_object.thread.join()
         del cyclic_object
-        self.assertEqual(None, weak_cyclic_object(),
+        self.assertIsNone(weak_cyclic_object(),
                          msg=('%d references still around' %
                               sys.getrefcount(weak_cyclic_object())))
 
@@ -404,7 +404,7 @@
         weak_raising_cyclic_object = weakref.ref(raising_cyclic_object)
         raising_cyclic_object.thread.join()
         del raising_cyclic_object
-        self.assertEqual(None, weak_raising_cyclic_object(),
+        self.assertIsNone(weak_raising_cyclic_object(),
                          msg=('%d references still around' %
                               sys.getrefcount(weak_raising_cyclic_object())))
 

Modified: python/branches/py3k/Lib/test/test_winreg.py
==============================================================================
--- python/branches/py3k/Lib/test/test_winreg.py	(original)
+++ python/branches/py3k/Lib/test/test_winreg.py	Thu Jan  6 06:34:17 2011
@@ -341,8 +341,8 @@
         with OpenKey(HKEY_LOCAL_MACHINE, "Software") as key:
             # HKLM\Software is redirected but not reflected in all OSes
             self.assertTrue(QueryReflectionKey(key))
-            self.assertEqual(None, EnableReflectionKey(key))
-            self.assertEqual(None, DisableReflectionKey(key))
+            self.assertIsNone(EnableReflectionKey(key))
+            self.assertIsNone(DisableReflectionKey(key))
             self.assertTrue(QueryReflectionKey(key))
 
     @unittest.skipUnless(HAS_REFLECTION, "OS doesn't support reflection")


More information about the Python-checkins mailing list