diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-02-23 14:43:42 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-02-23 14:43:42 -0800 |
commit | 90fdb6b1cb0b93418f2b5c3ffeb4fa224bb72de7 (patch) | |
tree | 076904cbd9e8436c92477c8f14fd5090500a384b /test_isort.py | |
parent | 1ed9402c005163f5ed787c9bf48a33affa295956 (diff) | |
download | isort-90fdb6b1cb0b93418f2b5c3ffeb4fa224bb72de7.tar.gz |
Add initial test case for relative import sorting issue
Diffstat (limited to 'test_isort.py')
-rw-r--r-- | test_isort.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test_isort.py b/test_isort.py index bdd4453c..e7999756 100644 --- a/test_isort.py +++ b/test_isort.py @@ -2715,3 +2715,20 @@ def test_comments_not_removed_issue_576(): '# this comment is important and should not be removed\n' 'from sys import api_version as api_version\n') assert SortImports(file_contents=test_input).output == test_input + + +def test_inconsistent_relative_imports_issue_577(): + test_input = ('from . import lorem\n' + 'from . import ipsum\n' + 'from .dolor import consecteur\n' + 'from .sit import apidiscing\n' + 'from .. import donec\n' + 'from .. import euismod\n' + 'from ..mi import iaculis\n' + 'from ..nec import tempor\n' + 'from ... import diam\n' + 'from ... import dui\n' + 'from ...eu import dignissim\n' + 'from ...ex import metus\n') + assert SortImports(file_contents=test_input).output == test_input + |