MCPcopy Index your code
hub / github.com/python/cpython / setUp

Method setUp

Lib/test/test_tty.py:12–19  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

10class TestTty(unittest.TestCase):
11
12 def setUp(self):
13 master_fd, self.fd = os.openpty()
14 self.addCleanup(os.close, master_fd)
15 self.stream = self.enterContext(open(self.fd, 'wb', buffering=0))
16 self.fd = self.stream.fileno()
17 self.mode = termios.tcgetattr(self.fd)
18 self.addCleanup(termios.tcsetattr, self.fd, termios.TCSANOW, self.mode)
19 self.addCleanup(termios.tcsetattr, self.fd, termios.TCSAFLUSH, self.mode)
20
21 def check_cbreak(self, mode):
22 self.assertEqual(mode[3] & termios.ECHO, 0)

Callers

nothing calls this directly

Calls 4

addCleanupMethod · 0.80
enterContextMethod · 0.80
openFunction · 0.50
filenoMethod · 0.45

Tested by

no test coverage detected