summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_isort.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_isort.py b/tests/test_isort.py
index e4c61c3d..a6034a97 100644
--- a/tests/test_isort.py
+++ b/tests/test_isort.py
@@ -4828,3 +4828,13 @@ def test_parens_in_comment():
"""
expected_output = "from foo import bar # (some text in brackets)\n"
assert SortImports(file_contents=test_input).output == expected_output
+
+
+def test_as_imports_mixed():
+ """Test to ensure as imports can be mixed with non as. See issue #908"""
+ test_input = """from datetime import datetime
+import datetime.datetime as dt
+"""
+ assert (
+ SortImports(file_contents=test_input, keep_direct_and_as_imports=True).output == test_input
+ )