aboutsummaryrefslogtreecommitdiff
path: root/test/test_websockets.py
diff options
context:
space:
mode:
authorcoletdjnz <coletdjnz@protonmail.com>2024-01-20 10:39:49 +1300
committerGitHub <noreply@github.com>2024-01-20 10:39:49 +1300
commit69d31914952dd33082ac7019c6f76b43c45b9d06 (patch)
tree03d8366814564c84f349207939abb6d39c104114 /test/test_websockets.py
parent50e06e21a68e336198198bda332b8e7d2314f201 (diff)
[test] Skip source address tests if the address cannot be bound to (#8900)
Fixes https://github.com/yt-dlp/yt-dlp/issues/8890 Authored by: coletdjnz
Diffstat (limited to 'test/test_websockets.py')
-rw-r--r--test/test_websockets.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_websockets.py b/test/test_websockets.py
index af6142ea3..91bac3442 100644
--- a/test/test_websockets.py
+++ b/test/test_websockets.py
@@ -6,6 +6,8 @@ import sys
import pytest
+from test.helper import verify_address_availability
+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import http.client
@@ -227,6 +229,7 @@ class TestWebsSocketRequestHandlerConformance:
@pytest.mark.parametrize('handler', ['Websockets'], indirect=True)
def test_source_address(self, handler):
source_address = f'127.0.0.{random.randint(5, 255)}'
+ verify_address_availability(source_address)
with handler(source_address=source_address) as rh:
ws = validate_and_send(rh, Request(self.ws_base_url))
ws.send('source_address')