summaryrefslogtreecommitdiff
path: root/tests/test_isort.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_isort.py')
-rw-r--r--tests/test_isort.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/tests/test_isort.py b/tests/test_isort.py
index 8673ab46..d67bdcf7 100644
--- a/tests/test_isort.py
+++ b/tests/test_isort.py
@@ -778,14 +778,10 @@ def test_quotes_in_file() -> None:
assert SortImports(file_contents=test_input).output == test_input
test_input = "import os\n\n" '\'"""\'\n' "import foo\n"
- assert SortImports(file_contents=test_input).output == (
- "import os\n\nimport foo\n\n" '\'"""\'\n'
- )
+ assert SortImports(file_contents=test_input).output == test_input
- test_input = "import os\n\n" '"""Let us"""\n' "import foo\n" '"""okay?"""\n'
- assert SortImports(file_contents=test_input).output == (
- 'import os\n\nimport foo\n\n"""Let us"""\n"""okay?"""\n'
- )
+ test_input = "import os\n\n" '"""Let us"""\n' "import foo\n\n" '"""okay?"""\n'
+ assert SortImports(file_contents=test_input).output == test_input
test_input = "import os\n\n" '#"""\n' "import foo\n" '#"""'
assert SortImports(file_contents=test_input).output == (
@@ -1201,7 +1197,7 @@ def test_smart_lines_after_import_section() -> None:
" pass\n"
)
- # ensure logic works with both style comments
+ # the same logic does not apply to doc strings
test_input = (
"from a import b\n"
'"""\n'
@@ -1213,7 +1209,6 @@ def test_smart_lines_after_import_section() -> None:
assert SortImports(file_contents=test_input).output == (
"from a import b\n"
"\n"
- "\n"
'"""\n'
" comment should be ignored\n"
'"""\n'
@@ -1631,9 +1626,8 @@ def test_place_comments() -> None:
"\n"
"# isort:imports-thirdparty\n"
"# isort:imports-firstparty\n"
- "print('code')\n"
- "\n"
"# isort:imports-stdlib\n"
+ "\n"
)
expected_output = (
"\n# isort:imports-thirdparty\n"
@@ -1642,8 +1636,6 @@ def test_place_comments() -> None:
"# isort:imports-firstparty\n"
"import myproject.test\n"
"\n"
- "print('code')\n"
- "\n"
"# isort:imports-stdlib\n"
"import os\n"
"import sys\n"