diff options
| author | Timothy Crosley <timothy.crosley@gmail.com> | 2021-07-27 22:48:53 -0700 |
|---|---|---|
| committer | Timothy Crosley <timothy.crosley@gmail.com> | 2021-07-27 22:48:53 -0700 |
| commit | 915aa6814cc7eef2305b336f4457c667e8f9fc38 (patch) | |
| tree | b76b3d0a30f329b496cad02f796d9a46d864052b /tests | |
| parent | 8ae8d5045bcc4b80850d22fc4191dc36552d4e5b (diff) | |
| download | isort-915aa6814cc7eef2305b336f4457c667e8f9fc38.tar.gz | |
Fixed #1792: Sorting literals sometimes ignored when placed on first few lines of file.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/test_regressions.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/unit/test_regressions.py b/tests/unit/test_regressions.py index 449f83d5..1853893e 100644 --- a/tests/unit/test_regressions.py +++ b/tests/unit/test_regressions.py @@ -1828,3 +1828,44 @@ v = """ v="""""" ''' ) + + +def test_literal_sort_at_top_of_file_issue_1792(): + assert ( + isort.code( + '''"""I'm a docstring! Look at me!""" + +# isort: unique-list +__all__ = ["Foo", "Foo", "Bar"] + +from typing import final # arbitrary + + +@final +class Foo: + ... + + +@final +class Bar: + ... +''' + ) + == '''"""I'm a docstring! Look at me!""" + +# isort: unique-list +__all__ = ['Bar', 'Foo'] + +from typing import final # arbitrary + + +@final +class Foo: + ... + + +@final +class Bar: + ... +''' + ) |
