diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2020-01-17 21:37:21 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2020-01-17 21:37:21 -0800 |
commit | 5dc291e5aca527882e8d6bd1a702cd4235084aa7 (patch) | |
tree | 2b9b55e67a1be3e0e354bc36d07cb653375a6350 | |
parent | e42585bf7895dca1d9cfd6837acde8f13a0f90c0 (diff) | |
download | isort-feature/fix-issue-908.tar.gz |
Add test case for issue #908feature/fix-issue-908
-rw-r--r-- | tests/test_isort.py | 10 |
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 + ) |