summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
authorMarkus Unterwaditzer <markus@unterwaditzer.net>2015-06-21 23:22:33 +0200
committerMarkus Unterwaditzer <markus@unterwaditzer.net>2015-06-21 23:23:10 +0200
commit4592098a58de5425ce75f2a8768b79945c32d8bb (patch)
treec1858544e9091ab39db2946da5ef92edf7a6907d /tests/test_utils.py
parentbe2c42b570cf702cb33f2cc4e26e8e69fba5ad9e (diff)
downloadclick-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.py7
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'),