1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 12:06:04 +00:00

Revert "#N/A Run functional tests in travis-ci"

This reverts commit c6ec2df85bf12c4e1a24d38a6f93e70464cd4b4a.
This commit is contained in:
nvbn 2015-07-24 23:31:16 +03:00
parent c6ec2df85b
commit 09a4438d69

View File

@ -9,16 +9,15 @@ import pexpect
import pytest
root = str(Path(__file__).parent.parent.parent.resolve())
docker = os.environ.get('DOCKER', 'docker')
docker = os.environ.get('DOCKER', 'docker').split(' ')
def build_container(tag, dockerfile):
tmpdir = mkdtemp()
with Path(tmpdir).joinpath('Dockerfile').open('w') as file:
file.write(dockerfile)
if subprocess.call(
docker.split(' ') + ['build', '--tag={}'.format(tag), tmpdir],
cwd=root) != 0:
if subprocess.call(['docker', 'build', '--tag={}'.format(tag), tmpdir],
cwd=root) != 0:
raise Exception("Can't build a container")
shutil.rmtree(tmpdir)
@ -28,8 +27,7 @@ def spawn(tag, dockerfile):
tag = 'thefuck/{}'.format(tag)
build_container(tag, dockerfile)
proc = pexpect.spawnu(
'{} run --volume {}:/src --tty=true --interactive=true {}'.format(
docker, root, tag))
'docker run --volume {}:/src --tty=true --interactive=true {}'.format(root, tag))
proc.logfile = sys.stdout
proc.sendline('pip install /src')