summaryrefslogtreecommitdiff
path: root/tests/test_performance.py
diff options
context:
space:
mode:
authorTomáš Chvátal <tchvatal@suse.com>2020-03-12 12:35:21 +0100
committerTomáš Chvátal <tchvatal@suse.com>2020-03-12 12:35:21 +0100
commit6f78e3b7cec5adc7db56bae37f97adb05ca2ae5c (patch)
treec54a03735de33f07a6a3f28c170f70363ce67aa8 /tests/test_performance.py
parent9ad9e86d6834f3630ffec5f2536e9defb4839226 (diff)
downloadpexpect-git-6f78e3b7cec5adc7db56bae37f97adb05ca2ae5c.tar.gz
Do not directly call python and use sys.executable
This makes sure the tests and wrapper works on systems where there is no python2 nor /usr/bin/python available
Diffstat (limited to 'tests/test_performance.py')
-rwxr-xr-xtests/test_performance.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_performance.py b/tests/test_performance.py
index 63778af..d7e2cd6 100755
--- a/tests/test_performance.py
+++ b/tests/test_performance.py
@@ -45,7 +45,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
return 'for n in range(1, %d+1): print(n)' % n
def plain_range(self, n):
- e = pexpect.spawn('python', timeout=100)
+ e = pexpect.spawn(sys.executable, timeout=100)
self.assertEqual(e.expect(b'>>>'), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect(br'\.{3}'), 0)
@@ -53,7 +53,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)
def window_range(self, n):
- e = pexpect.spawn('python', timeout=100)
+ e = pexpect.spawn(sys.executable, timeout=100)
self.assertEqual(e.expect(b'>>>'), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect(r'\.{3}'), 0)
@@ -61,7 +61,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', timeout=100)
+ e = pexpect.spawn(sys.executable, timeout=100)
self.assertEqual(e.expect_exact([b'>>>']), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect_exact([b'...']), 0)
@@ -69,7 +69,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', timeout=100)
+ e = pexpect.spawn(sys.executable, timeout=100)
self.assertEqual(e.expect_exact([b'>>>']), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect_exact([b'...']), 0)
@@ -77,7 +77,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', timeout=100)
+ e = pexpect.spawn(sys.executable, 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)