Show More
@@ -13,6 +13,7 b' Contains Stdout writer' | |||||
13 | # Imports |
|
13 | # Imports | |
14 | #----------------------------------------------------------------------------- |
|
14 | #----------------------------------------------------------------------------- | |
15 |
|
15 | |||
|
16 | from IPython.utils import io | |||
16 | from .base import WriterBase |
|
17 | from .base import WriterBase | |
17 |
|
18 | |||
18 | #----------------------------------------------------------------------------- |
|
19 | #----------------------------------------------------------------------------- | |
@@ -30,5 +31,4 b' class StdoutWriter(WriterBase):' | |||||
30 |
|
31 | |||
31 | See base for more... |
|
32 | See base for more... | |
32 | """ |
|
33 | """ | |
33 |
|
34 | io.unicode_std_stream().write(output) | ||
34 | print(output) |
|
@@ -1,3 +1,4 b'' | |||||
|
1 | # coding: utf-8 | |||
1 | """ |
|
2 | """ | |
2 | Module with tests for stdout |
|
3 | Module with tests for stdout | |
3 | """ |
|
4 | """ | |
@@ -43,9 +44,11 b' class TestStdout(TestsBase):' | |||||
43 |
|
44 | |||
44 | # Create stdout writer, test output |
|
45 | # Create stdout writer, test output | |
45 | writer = StdoutWriter() |
|
46 | writer = StdoutWriter() | |
46 | writer.write('a', {'b': 'c'}) |
|
47 | writer.write(u'a×', {'b': 'c'}) | |
47 | output = stream.getvalue() |
|
48 | output = stream.getvalue() | |
48 | self.fuzzy_compare(output, 'a') |
|
49 | if not PY3: | |
|
50 | output = output.decode('utf-8') | |||
|
51 | self.fuzzy_compare(output, u'a×') | |||
49 |
|
52 | |||
50 | # Revert stdout |
|
53 | # Revert stdout | |
51 | sys.stdout = stdout No newline at end of file |
|
54 | sys.stdout = stdout |
General Comments 0
You need to be logged in to leave comments.
Login now