[Python-checkins] cpython (2.7): Issue #16792: Use assertIs() to test identity.

serhiy.storchaka python-checkins at python.org
Thu Dec 27 23:47:07 CET 2012


http://hg.python.org/cpython/rev/327896bf3152
changeset:   81112:327896bf3152
branch:      2.7
parent:      81109:a617a50d2766
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Dec 28 00:44:20 2012 +0200
summary:
  Issue #16792: Use assertIs() to test identity.

files:
  Lib/test/test_int.py |  8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py
--- a/Lib/test/test_int.py
+++ b/Lib/test/test_int.py
@@ -380,11 +380,11 @@
 
     @test_support.cpython_only
     def test_small_ints(self):
-        self.assertTrue(int('10') is 10)
-        self.assertTrue(int('-1') is -1)
+        self.assertIs(int('10'), 10)
+        self.assertIs(int('-1'), -1)
         if have_unicode:
-            self.assertTrue(int(u'10') is 10)
-            self.assertTrue(int(u'-1') is -1)
+            self.assertIs(int(u'10'), 10)
+            self.assertIs(int(u'-1'), -1)
 
     def test_intconversion(self):
         # Test __int__()

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


More information about the Python-checkins mailing list