summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_isort.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_isort.py b/tests/test_isort.py
index 66398eca..8cabcce2 100644
--- a/tests/test_isort.py
+++ b/tests/test_isort.py
@@ -4806,3 +4806,15 @@ class WeiboMblogPipeline(object):
return item
"""
assert SortImports(file_contents=test_input).output == test_input
+
+
+def test_multiple_aliases():
+ """Test to ensure isort will retain multiple aliases. See issue #1037"""
+ test_input = """import datetime
+import datetime as datetime
+import datetime as dt
+import datetime as dt2
+"""
+ assert (
+ SortImports(keep_direct_and_as_imports=True, file_contents=test_input).output == test_input
+ )