File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 3
3
from pathlib import Path
4
4
from shutil import rmtree
5
5
from tempfile import mkdtemp
6
- from typing import Any
6
+ from typing import TYPE_CHECKING , Any
7
7
from unittest .mock import Mock , patch
8
8
9
9
import pytest
18
18
from tests .lib import TestData
19
19
from tests .lib .requests_mocks import MockResponse
20
20
21
+ if TYPE_CHECKING :
22
+ from requests .models import Response
23
+ else :
24
+ from pip ._vendor .requests .models import Response
25
+
21
26
22
27
def test_unpack_url_with_urllib_response_without_content_type (data : TestData ) -> None :
23
28
"""
24
29
It should download and unpack files even if no Content-Type header exists
25
30
"""
26
31
_real_session = PipSession ()
27
32
28
- def _fake_session_get (* args : Any , ** kwargs : Any ) -> dict [ str , str ] :
33
+ def _fake_session_get (* args : Any , ** kwargs : Any ) -> Response :
29
34
resp = _real_session .get (* args , ** kwargs )
30
35
del resp .headers ["Content-Type" ]
31
36
return resp
You can’t perform that action at this time.
0 commit comments