summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2020-03-19 22:10:48 -0700
committerTimothy Crosley <timothy.crosley@gmail.com>2020-03-19 22:10:48 -0700
commit214d412dfa31ea4b54cac2ef28f85f35d9137181 (patch)
treead2c42ca53b5a9a37f4b19302d880ce6763b4bc0
parent32d46cc3581c01624e3c96ab4483e0a970b8d493 (diff)
downloadisort-214d412dfa31ea4b54cac2ef28f85f35d9137181.tar.gz
Update test case to flag existing syntax error
-rw-r--r--tests/test_isort.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_isort.py b/tests/test_isort.py
index f86a764d..ed559c05 100644
--- a/tests/test_isort.py
+++ b/tests/test_isort.py
@@ -19,7 +19,7 @@ from isort import finders, main, sections, api
from isort.main import SortImports, is_python_file
from isort.settings import WrapModes, Config
from isort.utils import exists_case_sensitive
-from isort.exceptions import FileSkipped
+from isort.exceptions import FileSkipped, ExistingSyntaxErrors
try:
import toml
@@ -1200,7 +1200,8 @@ def test_atomic_mode() -> None:
# with syntax error content is not changed
test_input += "while True print 'Hello world'" # blatant syntax error
- assert api.sort_code_string(test_input, atomic=True) == test_input
+ with pytest.raises(ExistingSyntaxErrors):
+ api.sort_code_string(test_input, atomic=True)
def test_order_by_type() -> None: