MCPcopy Create free account
hub / github.com/pexpect/pexpect / faster_range

Method faster_range

tests/test_performance.py:79–83  ·  view source on GitHub ↗
(self, n)

Source from the content-addressed store, hash-verified

77 self.assertEqual(e.expect_exact([b'inquisition', '%d' % n], searchwindowsize=20), 1)
78
79 def faster_range(self, n):
80 e = pexpect.spawn(sys.executable, timeout=100)
81 self.assertEqual(e.expect(b'>>>'), 0)
82 e.sendline(('list(range(1, %d+1))' % n).encode('ascii'))
83 self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)
84
85 def test_100000(self):
86 if platform.python_implementation() == 'PyPy':

Callers 1

test_100000Method · 0.95

Calls 4

expectMethod · 0.80
encodeMethod · 0.80
spawnMethod · 0.45
sendlineMethod · 0.45

Tested by

no test coverage detected