From a1ff28cec80c146172fad1bc50a8f9a87f0552d4 Mon Sep 17 00:00:00 2001 From: Nicolas Duchon Date: Wed, 1 Sep 2021 09:31:02 +0200 Subject: [PATCH] CI: ease version check on python docker module --- test/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index bacdaef..3e0f3af 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -13,6 +13,7 @@ import docker import pytest import requests from _pytest._code.code import ReprExceptionInfo +from distutils.version import LooseVersion from docker.models.containers import Container from requests.packages.urllib3.util.connection import HAS_IPV6 @@ -488,5 +489,5 @@ try: except docker.errors.ImageNotFound: pytest.exit("The docker image 'nginxproxy/nginx-proxy:test' is missing") -if docker.__version__ != "5.0.0": - pytest.exit("This test suite is meant to work with the python docker module v5.0.0") +if LooseVersion(docker.__version__) < LooseVersion("5.0.0"): + pytest.exit("This test suite is meant to work with the python docker module v5.0.0 or later")