mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
test_console_output: Implement the entire TextIO contract.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
702ce071f4
commit
d40f3d54f1
@@ -68,8 +68,8 @@ from zerver.lib.streams import (
|
||||
from zerver.lib.test_console_output import (
|
||||
ExtraConsoleOutputFinder,
|
||||
ExtraConsoleOutputInTestException,
|
||||
TeeStderrAndFindExtraConsoleOutput,
|
||||
TeeStdoutAndFindExtraConsoleOutput,
|
||||
tee_stderr_and_find_extra_console_output,
|
||||
tee_stdout_and_find_extra_console_output,
|
||||
)
|
||||
from zerver.lib.test_helpers import find_key_by_email, instrument_url
|
||||
from zerver.lib.users import get_api_key
|
||||
@@ -168,9 +168,9 @@ class ZulipTestCase(TestCase):
|
||||
if not settings.BAN_CONSOLE_OUTPUT:
|
||||
return super().run(result)
|
||||
extra_output_finder = ExtraConsoleOutputFinder()
|
||||
with TeeStderrAndFindExtraConsoleOutput(
|
||||
with tee_stderr_and_find_extra_console_output(
|
||||
extra_output_finder
|
||||
), TeeStdoutAndFindExtraConsoleOutput(extra_output_finder):
|
||||
), tee_stdout_and_find_extra_console_output(extra_output_finder):
|
||||
test_result = super().run(result)
|
||||
if extra_output_finder.full_extra_output:
|
||||
exception_message = f"""
|
||||
@@ -189,7 +189,7 @@ You should be able to quickly reproduce this failure with:
|
||||
test-backend --ban-console-output {self.id()}
|
||||
|
||||
Output:
|
||||
{extra_output_finder.full_extra_output}
|
||||
{extra_output_finder.full_extra_output.decode(errors="replace")}
|
||||
--------------------------------------------
|
||||
"""
|
||||
raise ExtraConsoleOutputInTestException(exception_message)
|
||||
|
||||
Reference in New Issue
Block a user