##// END OF EJS Templates
fix tests that depended on unicode sys.argv
MinRK -
Show More
@@ -148,7 +148,6 b' ZeroDivisionError Traceback (most recent call last)'
148 ZeroDivisionError: ...
148 ZeroDivisionError: ...
149 """
149 """
150
150
151 @py3compat.u_format
152 def doctest_tb_sysexit():
151 def doctest_tb_sysexit():
153 """
152 """
154 In [17]: %xmode plain
153 In [17]: %xmode plain
@@ -156,11 +155,11 b' Exception reporting mode: Plain'
156
155
157 In [18]: %run simpleerr.py exit
156 In [18]: %run simpleerr.py exit
158 An exception has occurred, use %tb to see the full traceback.
157 An exception has occurred, use %tb to see the full traceback.
159 SystemExit: (1, {u}'Mode = exit')
158 SystemExit: (1, 'Mode = exit')
160
159
161 In [19]: %run simpleerr.py exit 2
160 In [19]: %run simpleerr.py exit 2
162 An exception has occurred, use %tb to see the full traceback.
161 An exception has occurred, use %tb to see the full traceback.
163 SystemExit: (2, {u}'Mode = exit')
162 SystemExit: (2, 'Mode = exit')
164
163
165 In [20]: %tb
164 In [20]: %tb
166 Traceback (most recent call last):
165 Traceback (most recent call last):
@@ -170,7 +169,7 b' Traceback (most recent call last):'
170 sysexit(stat, mode)
169 sysexit(stat, mode)
171 File ... line 11, in sysexit
170 File ... line 11, in sysexit
172 raise SystemExit(stat, 'Mode = %s' % mode)
171 raise SystemExit(stat, 'Mode = %s' % mode)
173 SystemExit: (2, {u}'Mode = exit')
172 SystemExit: (2, 'Mode = exit')
174
173
175 In [21]: %xmode context
174 In [21]: %xmode context
176 Exception reporting mode: Context
175 Exception reporting mode: Context
@@ -198,7 +197,7 b' SystemExit Traceback (most recent call last)'
198 12
197 12
199 13 def bar(mode):
198 13 def bar(mode):
200 <BLANKLINE>
199 <BLANKLINE>
201 SystemExit: (2, {u}'Mode = exit')
200 SystemExit: (2, 'Mode = exit')
202
201
203 In [23]: %xmode verbose
202 In [23]: %xmode verbose
204 Exception reporting mode: Verbose
203 Exception reporting mode: Verbose
@@ -212,29 +211,29 b' SystemExit Traceback (most recent call last)'
212 31
211 31
213 ---> 32 bar(mode)
212 ---> 32 bar(mode)
214 global bar = <function bar at ...>
213 global bar = <function bar at ...>
215 global mode = {u}'exit'
214 global mode = 'exit'
216 <BLANKLINE>
215 <BLANKLINE>
217 ... in bar(mode={u}'exit')
216 ... in bar(mode='exit')
218 20 except:
217 20 except:
219 21 stat = 1
218 21 stat = 1
220 ---> 22 sysexit(stat, mode)
219 ---> 22 sysexit(stat, mode)
221 global sysexit = <function sysexit at ...>
220 global sysexit = <function sysexit at ...>
222 stat = 2
221 stat = 2
223 mode = {u}'exit'
222 mode = 'exit'
224 23 else:
223 23 else:
225 24 raise ValueError('Unknown mode')
224 24 raise ValueError('Unknown mode')
226 <BLANKLINE>
225 <BLANKLINE>
227 ... in sysexit(stat=2, mode={u}'exit')
226 ... in sysexit(stat=2, mode='exit')
228 9
227 9
229 10 def sysexit(stat, mode):
228 10 def sysexit(stat, mode):
230 ---> 11 raise SystemExit(stat, 'Mode = %s' % mode)
229 ---> 11 raise SystemExit(stat, 'Mode = %s' % mode)
231 global SystemExit = undefined
230 global SystemExit = undefined
232 stat = 2
231 stat = 2
233 mode = {u}'exit'
232 mode = 'exit'
234 12
233 12
235 13 def bar(mode):
234 13 def bar(mode):
236 <BLANKLINE>
235 <BLANKLINE>
237 SystemExit: (2, {u}'Mode = exit')
236 SystemExit: (2, 'Mode = exit')
238 """
237 """
239
238
240
239
@@ -200,11 +200,11 b' class TestMagicRunSimple(tt.TempFileMixin):'
200 "%%run '%s' C-third\n") % (tc, tc, tc)
200 "%%run '%s' C-third\n") % (tc, tc, tc)
201 self.mktmp(src, '.ipy')
201 self.mktmp(src, '.ipy')
202 out = """\
202 out = """\
203 ARGV 1-: [{u}'C-first']
203 ARGV 1-: ['C-first']
204 ARGV 1-: [{u}'C-second']
204 ARGV 1-: ['C-second']
205 tclass.py: deleting object: C-first
205 tclass.py: deleting object: C-first
206 ARGV 1-: [{u}'C-third']
206 ARGV 1-: ['C-third']
207 tclass.py: deleting object: C-second
207 tclass.py: deleting object: C-second
208 tclass.py: deleting object: C-third
208 tclass.py: deleting object: C-third
209 """
209 """
210 tt.ipexec_validate(self.fname, py3compat.u_format(out))
210 tt.ipexec_validate(self.fname, out)
General Comments 0
You need to be logged in to leave comments. Login now