summaryrefslogtreecommitdiff
path: root/tests/test_performance.py
diff options
context:
space:
mode:
authorJeff Quast <contact@jeffquast.com>2014-06-08 08:07:03 +0000
committerJeff Quast <contact@jeffquast.com>2014-06-08 08:07:03 +0000
commitabe09d65daa99aab33b08a00f2c183b67e7f9ad3 (patch)
treed024f355e65701d87a942d37b8fab01930e91909 /tests/test_performance.py
parent06f1bf9244ec8806288d1664b0421e19c8bd364a (diff)
downloadpexpect-git-abe09d65daa99aab33b08a00f2c183b67e7f9ad3.tar.gz
Solaris support, tested on SmartOS from cron(1).
Diffstat (limited to 'tests/test_performance.py')
-rwxr-xr-xtests/test_performance.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_performance.py b/tests/test_performance.py
index 163e4f2..7be0cf6 100755
--- a/tests/test_performance.py
+++ b/tests/test_performance.py
@@ -31,7 +31,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
'''Testing the performance of expect, with emphasis on wading through long
inputs. '''
-
+
if sys.version_info[0] >= 3:
@staticmethod
def _iter_n(n):
@@ -41,10 +41,10 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
else:
@staticmethod
def _iter_n(n):
- return 'for n in range(1, %d+1): print(n)' % n
+ return 'for n in range(1, %d+1): print(n)' % n
def plain_range(self, n):
- e = pexpect.spawn('python')
+ e = pexpect.spawn('python', timeout=100)
self.assertEqual(e.expect(b'>>>'), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect(br'\.{3}'), 0)
@@ -52,7 +52,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)
def window_range(self, n):
- e = pexpect.spawn('python')
+ e = pexpect.spawn('python', timeout=100)
self.assertEqual(e.expect(b'>>>'), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect(r'\.{3}'), 0)
@@ -60,7 +60,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
self.assertEqual(e.expect([b'inquisition', '%d' % n], searchwindowsize=20), 1)
def exact_range(self, n):
- e = pexpect.spawn('python')
+ e = pexpect.spawn('python', timeout=100)
self.assertEqual(e.expect_exact([b'>>>']), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect_exact([b'...']), 0)
@@ -68,7 +68,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
self.assertEqual(e.expect_exact([b'inquisition', '%d' % n],timeout=520), 1)
def ewin_range(self, n):
- e = pexpect.spawn('python')
+ e = pexpect.spawn('python', timeout=100)
self.assertEqual(e.expect_exact([b'>>>']), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect_exact([b'...']), 0)
@@ -76,7 +76,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
self.assertEqual(e.expect_exact([b'inquisition', '%d' % n], searchwindowsize=20), 1)
def faster_range(self, n):
- e = pexpect.spawn('python')
+ e = pexpect.spawn('python', timeout=100)
self.assertEqual(e.expect(b'>>>'), 0)
e.sendline(('list(range(1, %d+1))' % n).encode('ascii'))
self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)