From: Stefan Eissing Date: Wed, 28 Jun 2023 11:03:29 +0000 (+0000) Subject: tests: add the websockets python module version checks needed for our CI infra X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faefe15c12725e7cad217e017aaa311d2d6e0046;p=thirdparty%2Fapache%2Fhttpd.git tests: add the websockets python module version checks needed for our CI infra git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910654 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/modules/http2/test_800_websockets.py b/test/modules/http2/test_800_websockets.py index 2afa45edc3b..754ac00d624 100644 --- a/test/modules/http2/test_800_websockets.py +++ b/test/modules/http2/test_800_websockets.py @@ -5,8 +5,10 @@ import shutil import subprocess import time from datetime import timedelta, datetime +import packaging.version import pytest +import websockets from pyhttpd.result import ExecResult from pyhttpd.ws_util import WsFrameReader, WsFrame @@ -15,6 +17,9 @@ from .env import H2Conf, H2TestEnv log = logging.getLogger(__name__) +ws_version = packaging.version.parse(websockets.version.version) +ws_version_min = packaging.version.Version('10.4') + def ws_run(env: H2TestEnv, path, authority=None, do_input=None, inbytes=None, send_close=True, timeout=5, scenario='ws-stdin', @@ -80,6 +85,8 @@ def ws_run(env: H2TestEnv, path, authority=None, do_input=None, inbytes=None, @pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here") @pytest.mark.skipif(condition=not H2TestEnv().httpd_is_at_least("2.5.0"), reason=f'need at least httpd 2.5.0 for this') +@pytest.mark.skipif(condition=ws_version < ws_version_min, + reason=f'websockets is {ws_version}, need at least {ws_version_min}') class TestWebSockets: @pytest.fixture(autouse=True, scope='class')