diff options
author | Raymond Hettinger <python@rcn.com> | 2011-01-06 05:34:17 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2011-01-06 05:34:17 (GMT) |
commit | 7beae8a0d567022f959c70f0be367ced7af65808 (patch) | |
tree | a84cff32b0d73598d3bebb1e8c0ad97ad197792a /Lib | |
parent | 90a4b3162e6a6c39519d5b3c1be39accbf568db6 (diff) | |
download | cpython-7beae8a0d567022f959c70f0be367ced7af65808.zip cpython-7beae8a0d567022f959c70f0be367ced7af65808.tar.gz cpython-7beae8a0d567022f959c70f0be367ced7af65808.tar.bz2 |
Issue 10825: Minor updates to the test suite.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/datetimetester.py | 2 | ||||
-rw-r--r-- | Lib/test/test_httplib.py | 10 | ||||
-rw-r--r-- | Lib/test/test_threading.py | 4 | ||||
-rw-r--r-- | Lib/test/test_winreg.py | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index dddf0f8..b5822cc 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -202,7 +202,7 @@ class TestTimeZone(unittest.TestCase): 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) diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index fb80e7a..890b1b9 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -560,7 +560,7 @@ class RequestBodyTest(TestCase): 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 @@ class RequestBodyTest(TestCase): 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 @@ class RequestBodyTest(TestCase): 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 @@ class RequestBodyTest(TestCase): 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 @@ class RequestBodyTest(TestCase): 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()) diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 46d2f47..ecbbdbf 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -396,7 +396,7 @@ class ThreadTests(BaseTestCase): 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 @@ class ThreadTests(BaseTestCase): 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()))) diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py index b6b23c8..0c1bf29 100644 --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -341,8 +341,8 @@ class Win64WinregTests(BaseWinregTests): 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") |