From 8dcfb1b7f7c8077f001c5716e48f4dfd647aefa4 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Mon, 9 Oct 2017 22:05:02 +0100 Subject: [PATCH] testlib: Auto negotiate Docker API version Ubuntu 17.04 provides Docker 1.12.6, which has API version 1.24. `dev_requirements.txt` specifies the docker-py 2.5.1, which by default requests API version 1.30. Hence when the SSH unit tests try to run the container specified in `DockerizedSshDaemon` an error occurs ``` APIError: 400 Client Error: Bad Request ("client is newer than server (client API version: 1.30, server API version: 1.24)") ``` --- tests/testlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testlib.py b/tests/testlib.py index 75494ef7..d1e2a168 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -114,7 +114,7 @@ class TestCase(unittest.TestCase): class DockerizedSshDaemon(object): def __init__(self): - self.docker = docker.from_env() + self.docker = docker.from_env(version='auto') self.container_name = 'mitogen-test-%08x' % (random.getrandbits(64),) self.container = self.docker.containers.run( image='d2mw/mitogen-test',