File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -261,3 +261,31 @@ def foo():
261261 """
262262
263263 self .run_and_assert (tmpdir , input_code , expected )
264+
265+ @pytest .mark .xfail (
266+ reason = "Does not properly handle 'from' imports with multiple names"
267+ )
268+ def test_multiple_imports (self , add_dependency , tmpdir ):
269+ input_code = """
270+ from requests import Response, Timeout, get
271+ import csv
272+
273+ del Response, Timeout # just to make sure these names are used
274+
275+ url = input()
276+ get(url)
277+ csv.excel
278+ """
279+ expected = """
280+ from requests import Response, Timeout
281+ import csv
282+ from security import safe_requests
283+
284+ del Response, Timeout # just to make sure these names are used
285+
286+ url = input()
287+ safe_requests.get(url)
288+ csv.excel
289+ """
290+ self .run_and_assert (tmpdir , input_code , expected )
291+ add_dependency .assert_called_once_with (Security )
You can’t perform that action at this time.
0 commit comments