summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2023-05-01 21:48:06 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2023-05-14 19:19:29 +0200
commit554d93ee2718fb4131ee2b9733253cd4f1fc6619 (patch)
tree2921affdb3f5d63045f08aeb9f1f17244a13fb27
parent8763111aae725a8ff5ce65fbd105daeaaec3da24 (diff)
downloadastroid-git-554d93ee2718fb4131ee2b9733253cd4f1fc6619.tar.gz
Fix urllib3 tests following the release of v2.0.0 (#2162)
-rw-r--r--requirements_test_brain.txt2
-rw-r--r--tests/test_modutils.py7
2 files changed, 5 insertions, 4 deletions
diff --git a/requirements_test_brain.txt b/requirements_test_brain.txt
index b4778bae..2014e07a 100644
--- a/requirements_test_brain.txt
+++ b/requirements_test_brain.txt
@@ -8,5 +8,5 @@ regex
types-python-dateutil
six
types-six
-urllib3
+urllib3>1,<2
typing_extensions>=4.4.0
diff --git a/tests/test_modutils.py b/tests/test_modutils.py
index 0c8bee88..04f5eeed 100644
--- a/tests/test_modutils.py
+++ b/tests/test_modutils.py
@@ -28,9 +28,9 @@ from . import resources
try:
import urllib3 # pylint: disable=unused-import
- HAS_URLLIB3 = True
+ HAS_URLLIB3_V1 = urllib3.__version__.startswith("1")
except ImportError:
- HAS_URLLIB3 = False
+ HAS_URLLIB3_V1 = False
def _get_file_from_object(obj) -> str:
@@ -547,8 +547,9 @@ class ExtensionPackageWhitelistTest(unittest.TestCase):
)
-@pytest.mark.skipif(not HAS_URLLIB3, reason="This test requires urllib3.")
+@pytest.mark.skipif(not HAS_URLLIB3_V1, reason="This test requires urllib3 < 2.")
def test_file_info_from_modpath__SixMetaPathImporter() -> None:
+ """Six is not backported anymore in urllib3 v2.0.0+"""
assert modutils.file_info_from_modpath(["urllib3.packages.six.moves.http_client"])