pytest-docker-pexpect icon indicating copy to clipboard operation
pytest-docker-pexpect copied to clipboard

[Errno 2] No such file or directory on Mac

Open grundic opened this issue 8 years ago • 0 comments

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?

grundic avatar Apr 25 '16 21:04 grundic