File tree 1 file changed +8
-13
lines changed
1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -309,22 +309,17 @@ def test_2d_float32(self):
309
309
tm .assert_almost_equal (result , expected )
310
310
311
311
def test_console_encode (self ):
312
- import sys
313
-
314
- if py3compat .PY3 or sys .stdin .encoding is None :
312
+ """
313
+ On Python 2, if sys.stdin.encoding is None (IPython with zmq frontend)
314
+ common.console_encode should encode things as utf-8.
315
+ """
316
+ if py3compat .PY3 :
315
317
raise nose .SkipTest
316
318
317
- # stub test
318
- # need to mock-out sys.stdin.encoding=None for real test
319
- result = com .console_encode (u"\u05d0 " )
320
- try :
321
- expected = u"\u05d0 " .encode (sys .stdin .encoding )
322
-
323
- # lot of console encodings, ISO-8869-1, cp850, etc. won't encode
324
- # this character
319
+ with tm .stdin_encoding (encoding = None ):
320
+ result = com .console_encode (u"\u05d0 " )
321
+ expected = u"\u05d0 " .encode ('utf-8' )
325
322
self .assertEqual (result , expected )
326
- except UnicodeEncodeError :
327
- pass
328
323
329
324
330
325
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments