Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/test/test_richcmp.py

    r2 r391  
    107107            for i in xrange(len(realres)):
    108108                # results are bool, so we can use "is" here
    109                 self.assert_(realres[i] is expres[i])
     109                self.assertTrue(realres[i] is expres[i])
    110110
    111111    def test_mixed(self):
     
    164164                    realres = op(ta, tb)
    165165                    realres = getattr(realres, "x", realres)
    166                     self.assert_(realres is expres)
     166                    self.assertTrue(realres is expres)
    167167
    168168    def test_values(self):
     
    193193    def test_misbehavin(self):
    194194        class Misb:
    195             def __lt__(self, other): return 0
    196             def __gt__(self, other): return 0
    197             def __eq__(self, other): return 0
    198             def __le__(self, other): raise test_support.TestFailed, "This shouldn't happen"
    199             def __ge__(self, other): raise test_support.TestFailed, "This shouldn't happen"
    200             def __ne__(self, other): raise test_support.TestFailed, "This shouldn't happen"
    201             def __cmp__(self, other): raise RuntimeError, "expected"
     195            def __lt__(self_, other): return 0
     196            def __gt__(self_, other): return 0
     197            def __eq__(self_, other): return 0
     198            def __le__(self_, other): self.fail("This shouldn't happen")
     199            def __ge__(self_, other): self.fail("This shouldn't happen")
     200            def __ne__(self_, other): self.fail("This shouldn't happen")
     201            def __cmp__(self_, other): raise RuntimeError, "expected"
    202202        a = Misb()
    203203        b = Misb()
     
    240240        # Even recursive lists of different lengths are different,
    241241        # but they cannot be ordered
    242         self.assert_(not (a == b))
    243         self.assert_(a != b)
     242        self.assertTrue(not (a == b))
     243        self.assertTrue(a != b)
    244244        self.assertRaises(RuntimeError, operator.lt, a, b)
    245245        self.assertRaises(RuntimeError, operator.le, a, b)
     
    251251        a.insert(0, 11)
    252252        b.insert(0, 12)
    253         self.assert_(not (a == b))
    254         self.assert_(a != b)
    255         self.assert_(a < b)
     253        self.assertTrue(not (a == b))
     254        self.assertTrue(a != b)
     255        self.assertTrue(a < b)
    256256
    257257class DictTest(unittest.TestCase):
     
    272272        imag2 = imag1b.copy()
    273273        imag2[k] = v + 1.0
    274         self.assert_(imag1a == imag1a)
    275         self.assert_(imag1a == imag1b)
    276         self.assert_(imag2 == imag2)
    277         self.assert_(imag1a != imag2)
     274        self.assertTrue(imag1a == imag1a)
     275        self.assertTrue(imag1a == imag1b)
     276        self.assertTrue(imag2 == imag2)
     277        self.assertTrue(imag1a != imag2)
    278278        for opname in ("lt", "le", "gt", "ge"):
    279279            for op in opmap[opname]:
     
    281281
    282282class ListTest(unittest.TestCase):
    283 
    284     def assertIs(self, a, b):
    285         self.assert_(a is b)
    286283
    287284    def test_coverage(self):
     
    331328
    332329def test_main():
    333     test_support.run_unittest(VectorTest, NumberTest, MiscTest, DictTest, ListTest)
     330    test_support.run_unittest(VectorTest, NumberTest, MiscTest, ListTest)
     331    with test_support.check_py3k_warnings(("dict inequality comparisons "
     332                                             "not supported in 3.x",
     333                                             DeprecationWarning)):
     334        test_support.run_unittest(DictTest)
     335
    334336
    335337if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.