[Python-checkins] cpython (2.7): Remove unnecessary imports and use assertIs instead of assertTrue.

ezio.melotti python-checkins at python.org
Tue Apr 12 15:07:29 CEST 2011


http://hg.python.org/cpython/rev/61f25c9e7fa1
changeset:   69267:61f25c9e7fa1
branch:      2.7
user:        Ezio Melotti
date:        Tue Apr 12 16:06:43 2011 +0300
summary:
  Remove unnecessary imports and use assertIs instead of assertTrue.

files:
  Lib/json/tests/test_scanstring.py |  1 -
  Lib/json/tests/test_speedups.py   |  7 +++----
  2 files changed, 3 insertions(+), 5 deletions(-)


diff --git a/Lib/json/tests/test_scanstring.py b/Lib/json/tests/test_scanstring.py
--- a/Lib/json/tests/test_scanstring.py
+++ b/Lib/json/tests/test_scanstring.py
@@ -1,5 +1,4 @@
 import sys
-import decimal
 from unittest import TestCase, skipUnless
 
 import json
diff --git a/Lib/json/tests/test_speedups.py b/Lib/json/tests/test_speedups.py
--- a/Lib/json/tests/test_speedups.py
+++ b/Lib/json/tests/test_speedups.py
@@ -1,4 +1,3 @@
-import decimal
 from unittest import TestCase, skipUnless
 
 from json import decoder, encoder, scanner
@@ -12,12 +11,12 @@
 class TestSpeedups(TestCase):
     def test_scanstring(self):
         self.assertEqual(decoder.scanstring.__module__, "_json")
-        self.assertTrue(decoder.scanstring is decoder.c_scanstring)
+        self.assertIs(decoder.scanstring, decoder.c_scanstring)
 
     def test_encode_basestring_ascii(self):
         self.assertEqual(encoder.encode_basestring_ascii.__module__, "_json")
-        self.assertTrue(encoder.encode_basestring_ascii is
-                          encoder.c_encode_basestring_ascii)
+        self.assertIs(encoder.encode_basestring_ascii,
+                      encoder.c_encode_basestring_ascii)
 
 class TestDecode(TestCase):
     def test_make_scanner(self):

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


More information about the Python-checkins mailing list