From 080a9038ee4ccefdf6b70800c10e40836e4015cc Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Sun, 4 Oct 2020 17:08:46 -0700 Subject: [PATCH] Add failing test for #1523 --- tests/unit/test_regressions.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit/test_regressions.py b/tests/unit/test_regressions.py index 757595224..3a1d94e06 100644 --- a/tests/unit/test_regressions.py +++ b/tests/unit/test_regressions.py @@ -1273,3 +1273,14 @@ def d(): ''', show_diff=True, ) + + +def test_isort_should_keep_all_as_and_non_as_imports_issue_1523(): + """isort should keep as and non-as imports of the same path that happen to exist within the + same statement. + See: https://github.com/PyCQA/isort/issues/1523. + """ + assert isort.check_code( + """ +from selenium.webdriver import Remote, Remote as Driver +""", show_diff=True, combine_as_imports=True)