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.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_isort.py b/tests/test_isort.py
index 0228b414..efff42c4 100644
--- a/tests/test_isort.py
+++ b/tests/test_isort.py
@@ -4702,3 +4702,23 @@ from flask_security.signals import user_confirmed # noqa
from flask_security.signals import user_registered # noqa
"""
assert SortImports(file_contents=test_input).output == expected_output
+
+
+def test_single_line_exclusions():
+ test_input = """
+# start comment
+from os import path, system
+from typing import List, TypeVar
+"""
+ expected_output = """
+# start comment
+from os import path
+from os import system
+from typing import List, TypeVar
+"""
+ assert (
+ SortImports(
+ file_contents=test_input, force_single_line=True, single_line_exclusions=("typing",)
+ ).output
+ == expected_output
+ )