summaryrefslogtreecommitdiff
path: root/tests/test_isalive.py
diff options
context:
space:
mode:
authordluyer <53582923+dluyer@users.noreply.github.com>2019-08-07 09:33:45 -0700
committerThomas Kluyver <thomas@kluyver.me.uk>2019-08-07 17:33:45 +0100
commitecd3a19ee16723170f6ba583c92f0a0c51b02115 (patch)
tree14b8328dae966bebaeb4a525ee3a834379939013 /tests/test_isalive.py
parent6a4fc7c3e54217d5d90956d51829beac0f475010 (diff)
downloadpexpect-git-ecd3a19ee16723170f6ba583c92f0a0c51b02115.tar.gz
Always use self.PYTHONBIN not 'python' or sys.executable in tests (#580)
* s/sys.executable/self.PYTHONBIN/ * s/sys.executable/self.PYTHONBIN/ * Update test_isalive.py * s/sys.executable/self.PYTHONBIN/ * s/sys.executable/self.PYTHONBIN/ * Support cases where pythonbin != sys.executable * Support cases where pythonbin != sys.executable * Fix raw use of 'python' to use self.PYTHONBIN * Fix test_pxssh.py when PYTHONBIN != 'python' The fake 'ssh' will be started via #!/usr/bin/env python, when it may need to use sys.executable or some other self.PYTHONBIN. * Remove unnecessary changes from pull request. * Remove unnecessary changes from pull request.
Diffstat (limited to 'tests/test_isalive.py')
-rwxr-xr-xtests/test_isalive.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_isalive.py b/tests/test_isalive.py
index cd79d09..5e3021e 100755
--- a/tests/test_isalive.py
+++ b/tests/test_isalive.py
@@ -57,7 +57,7 @@ class IsAliveTestCase(PexpectTestCase.PexpectTestCase):
'''Test calling wait with a process terminated by a signal.'''
if not hasattr(signal, 'SIGALRM'):
return 'SKIP'
- p = pexpect.spawn(sys.executable, ['alarm_die.py'])
+ p = pexpect.spawn(self.PYTHONBIN, ['alarm_die.py'])
p.wait()
assert p.exitstatus is None
self.assertEqual(p.signalstatus, signal.SIGALRM)
@@ -99,7 +99,7 @@ class IsAliveTestCase(PexpectTestCase.PexpectTestCase):
assert not p.isalive()
def test_forced_terminate(self):
- p = pexpect.spawn(sys.executable, ['needs_kill.py'])
+ p = pexpect.spawn(self.PYTHONBIN, ['needs_kill.py'])
p.expect('READY')
assert p.terminate(force=True) == True
p.expect(pexpect.EOF)