MCPcopy
hub / github.com/pytest-dev/pytest / test_isatty

Method test_isatty

testing/test_terminal.py:474–481  ·  view source on GitHub ↗
(self, pytester: Pytester, monkeypatch, isatty: bool)

Source from the content-addressed store, hash-verified

472
473 @pytest.mark.parametrize("isatty", [True, False])
474 def test_isatty(self, pytester: Pytester, monkeypatch, isatty: bool) -> None:
475 config = pytester.parseconfig()
476 f = StringIO()
477 monkeypatch.setattr(f, "isatty", lambda: isatty)
478 tr = TerminalReporter(config, f)
479 assert tr.isatty() == isatty
480 # It was incorrectly implemented as a boolean so we still support using it as one.
481 assert bool(tr.isatty) == isatty
482
483
484class TestCollectonly:

Callers

nothing calls this directly

Calls 4

TerminalReporterClass · 0.90
setattrMethod · 0.80
parseconfigMethod · 0.45
isattyMethod · 0.45

Tested by

no test coverage detected