diff options
| author | Timothy Crosley <timothy.crosley@gmail.com> | 2021-11-03 00:27:55 -0700 |
|---|---|---|
| committer | Timothy Crosley <timothy.crosley@gmail.com> | 2021-11-03 00:27:55 -0700 |
| commit | 73245e942de97fe1a4a2d968bbde3c168a97e64c (patch) | |
| tree | 14183af9544c2b9f7e6013e61576d6ba3f61d871 /tests | |
| parent | 223dc4cdf41e5557f28498b050a5ef1c02fef50c (diff) | |
| download | isort-73245e942de97fe1a4a2d968bbde3c168a97e64c.tar.gz | |
Fixes #1838: don't append imports where no imports are present
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/test_ticketed_features.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/test_ticketed_features.py b/tests/unit/test_ticketed_features.py index dde08be6..ca39c0f9 100644 --- a/tests/unit/test_ticketed_features.py +++ b/tests/unit/test_ticketed_features.py @@ -213,6 +213,19 @@ import os """ ) + # issue 1838: don't append in middle of class + assert isort.check_code( + '''class C: + """a + + """ + # comment +''', + append_only=True, + add_imports=["from __future__ import annotations"], + show_diff=True, + ) + def test_isort_supports_shared_profiles_issue_970(): """Test to ensure isort provides a way to use shared profiles. |
