MCPcopy
hub / github.com/pallets/click / test_isolation_stderr_errors

Function test_isolation_stderr_errors

tests/test_testing.py:457–465  ·  tests/test_testing.py::test_isolation_stderr_errors

Writing to stderr should escape invalid characters instead of raising a UnicodeEncodeError.

()

Source from the content-addressed store, hash-verified

455
456
457def test_isolation_stderr_errors():
458 class="st">"""Writing to stderr should escape invalid characters instead of
459 raising a UnicodeEncodeError.
460 class="st">"""
461 runner = CliRunner()
462
463 with runner.isolation() as (_, err, _):
464 click.echo(class="st">"\udce2", err=True, nl=False)
465 assert err.getvalue() == bclass="st">"\\udce2"
466
467
468def test_isolation_flushes_unflushed_stderr():

Callers

nothing calls this directly

Calls 3

isolationMethod · 0.95
CliRunnerClass · 0.90
getvalueMethod · 0.80

Tested by

no test coverage detected