MCPcopy Create free account
hub / github.com/pyinvoke/invoke / replaced_stdin_objects_dont_explode

Method replaced_stdin_objects_dont_explode

tests/runners.py:1609–1615  ·  view source on GitHub ↗
(self, mock_sys)

Source from the content-addressed store, hash-verified

1607
1608 @patch("invoke.runners.sys")
1609 def replaced_stdin_objects_dont_explode(self, mock_sys):
1610 # Replace sys.stdin with an object lacking .isatty(), which
1611 # normally causes an AttributeError unless we are being careful.
1612 mock_sys.stdin = object()
1613 # Test. If bug is present, this will error.
1614 runner = Local(Context())
1615 assert runner.should_use_pty(pty=True, fallback=True) is False
1616
1617 @mock_pty(trailing_error=OSError("Input/output error"))
1618 def spurious_OSErrors_handled_gracefully(self):

Callers

nothing calls this directly

Calls 3

should_use_ptyMethod · 0.95
LocalClass · 0.90
ContextClass · 0.90

Tested by

no test coverage detected