pytest-docker-pexpect
pytest-docker-pexpect copied to clipboard
[Errno 2] No such file or directory on Mac
Tried to run plugin on Mac and got this error.
Checked location of docker (installed through brew
)
$ which docker
/usr/local/bin/docker
And content of $PATH
>>> os.environ['PATH']
'/usr/bin:/bin:/usr/sbin:/sbin:/Users/username/.virtualenvs/project/bin'
The root of the problem is clear. Here is my elementary solution:
def test_echo(self, spawnu):
import os
os.environ['PATH'] = '{}:{}'.format('/usr/local/bin', os.environ['PATH'])
proc = spawnu(u'ubuntu', u'FROM ubuntu:latest', 'bash')
proc.sendline(u'ls')
Can you think of better solution for it?