MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_isatty

Method test_isatty

Lib/test/test_io.py:2385–2404  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2383 writer.close = lambda: None
2384
2385 def test_isatty(self):
2386 class SelectableIsAtty(MockRawIO):
2387 def __init__(self, isatty):
2388 MockRawIO.__init__(self)
2389 self._isatty = isatty
2390
2391 def isatty(self):
2392 return self._isatty
2393
2394 pair = self.tp(SelectableIsAtty(False), SelectableIsAtty(False))
2395 self.assertFalse(pair.isatty())
2396
2397 pair = self.tp(SelectableIsAtty(True), SelectableIsAtty(False))
2398 self.assertTrue(pair.isatty())
2399
2400 pair = self.tp(SelectableIsAtty(False), SelectableIsAtty(True))
2401 self.assertTrue(pair.isatty())
2402
2403 pair = self.tp(SelectableIsAtty(True), SelectableIsAtty(True))
2404 self.assertTrue(pair.isatty())
2405
2406 def test_weakref_clearing(self):
2407 brw = self.tp(self.MockRawIO(), self.MockRawIO())

Callers

nothing calls this directly

Calls 4

SelectableIsAttyClass · 0.85
assertFalseMethod · 0.80
assertTrueMethod · 0.80
isattyMethod · 0.45

Tested by

no test coverage detected