diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-05-01 21:48:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 21:48:06 +0200 |
commit | 9e103147c986a098181564b606a5fc95697df2c1 (patch) | |
tree | 947a17ff92410b67cf624fa53f96294550bdf53a | |
parent | faea71172f0a13482d23861de0c53cf101b0d108 (diff) | |
download | astroid-git-9e103147c986a098181564b606a5fc95697df2c1.tar.gz |
Fix urllib3 tests following the release of v2.0.0 (#2162)
-rw-r--r-- | requirements_full.txt | 2 | ||||
-rw-r--r-- | tests/test_modutils.py | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/requirements_full.txt b/requirements_full.txt index 3e332a2b..346aa275 100644 --- a/requirements_full.txt +++ b/requirements_full.txt @@ -9,5 +9,5 @@ python-dateutil PyQt6 regex six -urllib3 +urllib3>1,<2 typing_extensions>=4.4.0 diff --git a/tests/test_modutils.py b/tests/test_modutils.py index be99bdb1..9dcdc811 100644 --- a/tests/test_modutils.py +++ b/tests/test_modutils.py @@ -28,9 +28,9 @@ from . import resources try: import urllib3 # type: ignore[import] # 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"]) |