fix(dashboard-testing): use a complete private output stream for pytest
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user