Skip test on bad w3lib

This commit is contained in:
Adrian Chaves 2026-08-09 17:55:27 +02:00
parent f341b51cf2
commit 829462020b
1 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,7 @@ from contextlib import contextmanager
from pathlib import Path
from typing import TYPE_CHECKING, Any
from unittest import mock
from urllib.parse import urlparse
import pytest
@ -781,7 +782,14 @@ class TestFilesystemStorageScope(ScopeTestMixin):
("url", "expected"),
[
("http://user:pass@WWW.Example.com:8080/", "www.example.com"),
("http://[::1]/", "%3A%3A1"),
pytest.param(
"http://[::1]/",
"%3A%3A1",
marks=pytest.mark.skipif(
urlparse(Request("http://[::1]/").url).hostname != "::1",
reason="w3lib strips the brackets of IPv6 hosts",
),
),
("file:///tmp/t.txt", "_"),
],
)