diff options
author | Markus Unterwaditzer <markus@unterwaditzer.net> | 2015-06-21 23:22:33 +0200 |
---|---|---|
committer | Markus Unterwaditzer <markus@unterwaditzer.net> | 2015-06-21 23:23:10 +0200 |
commit | 4592098a58de5425ce75f2a8768b79945c32d8bb (patch) | |
tree | c1858544e9091ab39db2946da5ef92edf7a6907d /tests/test_utils.py | |
parent | be2c42b570cf702cb33f2cc4e26e8e69fba5ad9e (diff) | |
download | click-4592098a58de5425ce75f2a8768b79945c32d8bb.tar.gz |
Fix crash when writing to unicode files
Fix #339
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r-- | tests/test_utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index 6b014e5..c31f0b9 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -39,6 +39,13 @@ def test_echo(runner): assert out.getvalue() == b'\x1b[31mx\x1b[39m' +def test_echo_custom_file(): + import io + f = io.StringIO() + click.echo(u'hello', file=f) + assert f.getvalue() == u'hello\n' + + def test_styling(): examples = [ ('x', dict(fg='black'), '\x1b[30mx\x1b[0m'), |