summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoah <noah@656d521f-e311-0410-88e0-e7920216d269>2003-05-08 03:56:47 +0000
committernoah <noah@656d521f-e311-0410-88e0-e7920216d269>2003-05-08 03:56:47 +0000
commitbb79ca8a6e81d069da251a06de07ee00611463a0 (patch)
tree5df6608d7945659041d3a1d6161a243512f3f27c
parent31ca1e412253e280a187d4c4041a1dd80134d1b1 (diff)
downloadpexpect-bb79ca8a6e81d069da251a06de07ee00611463a0.tar.gz
Fixed assumption about python binary path. Now I get it from the sys module
when I start. It is set in the PexpectTestCase class. git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@198 656d521f-e311-0410-88e0-e7920216d269
-rw-r--r--pexpect/tests/PexpectTestCase.py1
-rwxr-xr-xpexpect/tests/test_destructor.py24
-rwxr-xr-xpexpect/tests/test_winsize.py2
3 files changed, 14 insertions, 13 deletions
diff --git a/pexpect/tests/PexpectTestCase.py b/pexpect/tests/PexpectTestCase.py
index 87ea931..19f8c35 100644
--- a/pexpect/tests/PexpectTestCase.py
+++ b/pexpect/tests/PexpectTestCase.py
@@ -5,6 +5,7 @@ import os
class PexpectTestCase(unittest.TestCase):
def setUp(self):
+ self.PYTHONBIN = sys.executable
self.original_path = os.getcwd()
newpath = os.path.join (os.environ['PROJECT_PEXPECT_HOME'], 'tests')
os.chdir (newpath)
diff --git a/pexpect/tests/test_destructor.py b/pexpect/tests/test_destructor.py
index fe071d7..5f49154 100755
--- a/pexpect/tests/test_destructor.py
+++ b/pexpect/tests/test_destructor.py
@@ -7,10 +7,10 @@ import time
class TestCaseDestructor(PexpectTestCase.PexpectTestCase):
def test_destructor (self):
- p1 = pexpect.spawn('python hello_world.py')
- p2 = pexpect.spawn('python hello_world.py')
- p3 = pexpect.spawn('python hello_world.py')
- p4 = pexpect.spawn('python hello_world.py')
+ p1 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
+ p2 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
+ p3 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
+ p4 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
fd_t1 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd)
p1.expect(pexpect.EOF)
p2.expect(pexpect.EOF)
@@ -26,10 +26,10 @@ class TestCaseDestructor(PexpectTestCase.PexpectTestCase):
p4 = None
gc.collect()
time.sleep(1) # Some platforms are slow at gc... Solaris!
- p1 = pexpect.spawn('ls -l')
- p2 = pexpect.spawn('ls -l')
- p3 = pexpect.spawn('ls -l')
- p4 = pexpect.spawn('ls -l')
+ p1 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
+ p2 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
+ p3 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
+ p4 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
fd_t2 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd)
p1.kill(9)
p2.kill(9)
@@ -41,10 +41,10 @@ class TestCaseDestructor(PexpectTestCase.PexpectTestCase):
del (p4)
gc.collect()
time.sleep(1)
- p1 = pexpect.spawn('ls -l')
- p2 = pexpect.spawn('ls -l')
- p3 = pexpect.spawn('ls -l')
- p4 = pexpect.spawn('ls -l')
+ p1 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
+ p2 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
+ p3 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
+ p4 = pexpect.spawn('%s hello_world.py' % self.PYTHONBIN)
fd_t3 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd)
assert (fd_t1 == fd_t2 == fd_t3)
diff --git a/pexpect/tests/test_winsize.py b/pexpect/tests/test_winsize.py
index ebc9505..4d331e1 100755
--- a/pexpect/tests/test_winsize.py
+++ b/pexpect/tests/test_winsize.py
@@ -10,7 +10,7 @@ class TestCaseWinsize(PexpectTestCase.PexpectTestCase):
This tests that the child process can set and get the windows size.
This makes use of an external script sigwinch_report.py.
"""
- p1 = pexpect.spawn('python sigwinch_report.py')
+ p1 = pexpect.spawn('%s sigwinch_report.py' % self.PYTHONBIN)
time.sleep(1)
p1.setwinsize (11,22)
p1.expect ('SIGWINCH: \(([0-9]*), ([0-9]*)\)')