fix(dashboard-testing): use a complete private output stream for pytest

This commit is contained in:
2026-10-11 01:27:28 +03:00
parent 1bc68277e1
commit 0da33919d6
4 changed files with 45 additions and 17 deletions

View File

@@ -104,17 +104,6 @@ def read_connection(path: Path):
# #endregion Tooling.VerifyDashboardTestingCurrent.Connection
class PrivateOutput:
"""Discard uncategorized process output; publish structured reports instead."""
encoding = 'utf-8'
def write(self, value):
return len(value)
def flush(self):
return None
@contextmanager
def private_output():
"""Drop both Python and native-driver console output; structured evidence remains."""
@@ -123,7 +112,7 @@ def private_output():
with open(os.devnull, 'w') as sink:
os.dup2(sink.fileno(), 1)
os.dup2(sink.fileno(), 2)
with redirect_stdout(PrivateOutput()), redirect_stderr(PrivateOutput()):
with redirect_stdout(sink), redirect_stderr(sink):
yield
finally:
for fd, original in zip((1, 2), saved, strict=True):