Test hygiene: forget the refused study, quiet _Tee on a closed stream, wait for connector recovery
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
@@ -36,17 +36,19 @@ class _Tee(io.TextIOBase):
|
||||
sink(text)
|
||||
try:
|
||||
return self._real.write(text)
|
||||
except OSError:
|
||||
except (OSError, ValueError):
|
||||
# A dead stdout — `fluksio serve` runs the engine as a child of the
|
||||
# dashboard, which holds the far end of that pipe — must not fail
|
||||
# the node whose output was being teed. The capture above has it,
|
||||
# and there is nowhere left to report the loss to anyway.
|
||||
# and there is nowhere left to report the loss to anyway. A closed
|
||||
# one (ValueError) is the same at interpreter exit, when whatever
|
||||
# was wrapped — pytest's capture, say — has been closed first.
|
||||
return len(text)
|
||||
|
||||
def flush(self) -> None:
|
||||
try:
|
||||
self._real.flush()
|
||||
except OSError:
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
|
||||
def isatty(self) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user