@@ -62,20 +62,20 @@ def test_traceback(self):
6262 def f ():
6363 return 1 / 0
6464
65- def g ():
65+ def gfunc ():
6666 return f ()
6767
68- i .runsource ('g ()' )
68+ i .runsource ('gfunc ()' )
6969
7070 if pypy :
71- global_not_found = "global name 'g ' is not defined"
71+ global_not_found = "global name 'gfunc ' is not defined"
7272 else :
73- global_not_found = "name 'g ' is not defined"
73+ global_not_found = "name 'gfunc ' is not defined"
7474
7575 expected = (
7676 'Traceback (most recent call last):\n File ' +
7777 green ('"<input>"' ) + ', line ' +
78- bold (magenta ('1' )) + ', in ' + cyan ('<module>' ) + '\n g ()\n ' +
78+ bold (magenta ('1' )) + ', in ' + cyan ('<module>' ) + '\n gfunc ()\n ' +
7979 bold (red ('NameError' )) + ': ' + cyan (global_not_found ) + '\n ' )
8080
8181 self .assertMultiLineEqual (str (plain ('' ).join (a )), str (expected ))
@@ -133,19 +133,19 @@ def test_runsource_unicode_autoencode_and_noencode(self):
133133 # for auto and False, run the same tests
134134 for encode in ['auto' , False ]:
135135 i , a = self .interp_errlog ()
136- i .runsource (u'[1 + 1,\n abc ]' , encode = encode )
136+ i .runsource (u'[1 + 1,\n abcd ]' , encode = encode )
137137 self .assertEqual (self .err_lineno (a ), 2 )
138138
139139 i , a = self .interp_errlog ()
140- i .runsource (u'[1 + 1,\n abc ]' , encode = encode )
140+ i .runsource (u'[1 + 1,\n abcd ]' , encode = encode )
141141 self .assertEqual (self .err_lineno (a ), 2 )
142142
143143 i , a = self .interp_errlog ()
144- i .runsource (u'#encoding: utf-8\n abc ' , encode = encode )
144+ i .runsource (u'#encoding: utf-8\n abcd ' , encode = encode )
145145 self .assertEqual (self .err_lineno (a ), 2 )
146146
147147 i , a = self .interp_errlog ()
148- i .runsource (u'#encoding: utf-8\n abc ' ,
148+ i .runsource (u'#encoding: utf-8\n abcd ' ,
149149 filename = 'x.py' , encode = encode )
150150 self .assertIn ('SyntaxError:' ,
151151 '' .join ('' .join (remove_ansi (x .__unicode__ ())
@@ -164,46 +164,46 @@ def test_runsource_unicode_encode(self):
164164 @unittest .skipIf (py3 , "encode only does anything in Python 2" )
165165 def test_runsource_bytestring_noencode (self ):
166166 i , a = self .interp_errlog ()
167- i .runsource (b'[1 + 1,\n abc ]' , encode = False )
167+ i .runsource (b'[1 + 1,\n abcd ]' , encode = False )
168168 self .assertEqual (self .err_lineno (a ), 2 )
169169
170170 i , a = self .interp_errlog ()
171- i .runsource (b'[1 + 1,\n abc ]' , filename = 'x.py' , encode = False )
171+ i .runsource (b'[1 + 1,\n abcd ]' , filename = 'x.py' , encode = False )
172172 self .assertEqual (self .err_lineno (a ), 2 )
173173
174174 i , a = self .interp_errlog ()
175175 i .runsource (dedent (b'''\
176176 #encoding: utf-8
177177
178178 ["%s",
179- abc ]''' % (u'åß∂ƒ' .encode ('utf8' ),)), encode = False )
179+ abcd ]''' % (u'åß∂ƒ' .encode ('utf8' ),)), encode = False )
180180 self .assertEqual (self .err_lineno (a ), 4 )
181181
182182 i , a = self .interp_errlog ()
183183 i .runsource (dedent (b'''\
184184 #encoding: utf-8
185185
186186 ["%s",
187- abc ]''' % (u'åß∂ƒ' .encode ('utf8' ),)),
187+ abcd ]''' % (u'åß∂ƒ' .encode ('utf8' ),)),
188188 filename = 'x.py' , encode = False )
189189 self .assertEqual (self .err_lineno (a ), 4 )
190190
191191 @unittest .skipIf (py3 , "encode only does anything in Python 2" )
192192 def test_runsource_bytestring_encode (self ):
193193 i , a = self .interp_errlog ()
194- i .runsource (b'[1 + 1,\n abc ]' , encode = True )
194+ i .runsource (b'[1 + 1,\n abcd ]' , encode = True )
195195 self .assertEqual (self .err_lineno (a ), 2 )
196196
197197 i , a = self .interp_errlog ()
198198 with self .assertRaises (ValueError ):
199- i .runsource (b'[1 + 1,\n abc ]' , filename = 'x.py' , encode = True )
199+ i .runsource (b'[1 + 1,\n abcd ]' , filename = 'x.py' , encode = True )
200200
201201 i , a = self .interp_errlog ()
202202 i .runsource (dedent (b'''\
203203 #encoding: utf-8
204204
205205 [u"%s",
206- abc ]''' % (u'åß∂ƒ' .encode ('utf8' ),)), encode = True )
206+ abcd ]''' % (u'åß∂ƒ' .encode ('utf8' ),)), encode = True )
207207 self .assertEqual (self .err_lineno (a ), 4 )
208208
209209 i , a = self .interp_errlog ()
@@ -212,32 +212,32 @@ def test_runsource_bytestring_encode(self):
212212 #encoding: utf-8
213213
214214 [u"%s",
215- abc ]''' % (u'åß∂ƒ' .encode ('utf8' ),)),
215+ abcd ]''' % (u'åß∂ƒ' .encode ('utf8' ),)),
216216 filename = 'x.py' ,
217217 encode = True )
218218
219219 @unittest .skipIf (py3 , "encode only does anything in Python 2" )
220220 def test_runsource_bytestring_autoencode (self ):
221221 i , a = self .interp_errlog ()
222- i .runsource (b'[1 + 1,\n abc ]' )
222+ i .runsource (b'[1 + 1,\n abcd ]' )
223223 self .assertEqual (self .err_lineno (a ), 2 )
224224
225225 i , a = self .interp_errlog ()
226- i .runsource (b'[1 + 1,\n abc ]' , filename = 'x.py' )
226+ i .runsource (b'[1 + 1,\n abcd ]' , filename = 'x.py' )
227227 self .assertEqual (self .err_lineno (a ), 2 )
228228
229229 i , a = self .interp_errlog ()
230230 i .runsource (dedent (b'''\
231231 #encoding: utf-8
232232
233233 [u"%s",
234- abc ]''' % (u'åß∂ƒ' .encode ('utf8' ),)))
234+ abcd ]''' % (u'åß∂ƒ' .encode ('utf8' ),)))
235235 self .assertEqual (self .err_lineno (a ), 4 )
236236
237237 i , a = self .interp_errlog ()
238238 i .runsource (dedent (b'''\
239239 #encoding: utf-8
240240
241241 [u"%s",
242- abc ]''' % (u'åß∂ƒ' .encode ('utf8' ),)))
242+ abcd ]''' % (u'åß∂ƒ' .encode ('utf8' ),)))
243243 self .assertEqual (self .err_lineno (a ), 4 )
0 commit comments