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_codeop.py

    r2 r391  
    2424        if is_jython:
    2525            code = compile_command(str, "<input>", symbol)
    26             self.assert_(code)
     26            self.assertTrue(code)
    2727            if symbol == "single":
    2828                d,r = {},{}
     
    3838                d = { 'value': eval(code,ctx) }
    3939                r = { 'value': eval(str,ctx) }
    40             self.assertEquals(unify_callables(r),unify_callables(d))
     40            self.assertEqual(unify_callables(r),unify_callables(d))
    4141        else:
    4242            expected = compile(str, "<input>", symbol, PyCF_DONT_IMPLY_DEDENT)
    43             self.assertEquals( compile_command(str, "<input>", symbol), expected)
     43            self.assertEqual(compile_command(str, "<input>", symbol), expected)
    4444
    4545    def assertIncomplete(self, str, symbol='single'):
    4646        '''succeed iff str is the start of a valid piece of code'''
    47         self.assertEquals( compile_command(str, symbol=symbol), None)
     47        self.assertEqual(compile_command(str, symbol=symbol), None)
    4848
    4949    def assertInvalid(self, str, symbol='single', is_syntax=1):
     
    5151        try:
    5252            compile_command(str,symbol=symbol)
    53             self.fail("No exception thrown for invalid code")
     53            self.fail("No exception raised for invalid code")
    5454        except SyntaxError:
    55             self.assert_(is_syntax)
     55            self.assertTrue(is_syntax)
    5656        except OverflowError:
    57             self.assert_(not is_syntax)
     57            self.assertTrue(not is_syntax)
    5858
    5959    def test_valid(self):
     
    6262        # special case
    6363        if not is_jython:
    64             self.assertEquals(compile_command(""),
    65                             compile("pass", "<input>", 'single',
    66                                     PyCF_DONT_IMPLY_DEDENT))
    67             self.assertEquals(compile_command("\n"),
    68                             compile("pass", "<input>", 'single',
    69                                     PyCF_DONT_IMPLY_DEDENT))
     64            self.assertEqual(compile_command(""),
     65                             compile("pass", "<input>", 'single',
     66                                     PyCF_DONT_IMPLY_DEDENT))
     67            self.assertEqual(compile_command("\n"),
     68                             compile("pass", "<input>", 'single',
     69                                     PyCF_DONT_IMPLY_DEDENT))
    7070        else:
    7171            av("")
     
    291291
    292292    def test_filename(self):
    293         self.assertEquals(compile_command("a = 1\n", "abc").co_filename,
    294                           compile("a = 1\n", "abc", 'single').co_filename)
    295         self.assertNotEquals(compile_command("a = 1\n", "abc").co_filename,
    296                              compile("a = 1\n", "def", 'single').co_filename)
    297 
    298     def test_no_universal_newlines(self):
    299         code = compile_command("'\rfoo\r'", symbol='eval')
    300         self.assertEqual(eval(code), '\rfoo\r')
     293        self.assertEqual(compile_command("a = 1\n", "abc").co_filename,
     294                         compile("a = 1\n", "abc", 'single').co_filename)
     295        self.assertNotEqual(compile_command("a = 1\n", "abc").co_filename,
     296                            compile("a = 1\n", "def", 'single').co_filename)
    301297
    302298
Note: See TracChangeset for help on using the changeset viewer.