diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2020-01-15 22:46:38 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2020-01-15 22:46:38 -0800 |
commit | c80c384b8af51e01912f8bfe31228c8b7a126e5b (patch) | |
tree | 28d74f6aca9f4dd46f720222049b8903184cab87 | |
parent | 8ada14e5415617237a6e817d58ce2d197650b5f3 (diff) | |
download | isort-feature/fix-issue-1037.tar.gz |
Add a test case for 1037feature/fix-issue-1037
-rw-r--r-- | tests/test_isort.py | 12 |
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 + ) |