We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5473bfa commit 1621e19Copy full SHA for 1621e19
tests/test_api.py
@@ -0,0 +1,12 @@
1
+"""Tests the isort API module"""
2
+import pytest
3
+
4
+from isort import api, exceptions
5
6
7
+def test_sort_file_invalid_syntax(tmpdir) -> None:
8
+ """Test to ensure file encoding is respected"""
9
+ tmp_file = tmpdir.join(f"test_bad_syntax.py")
10
+ tmp_file.write_text("""print('mismathing quotes")""", "utf8")
11
+ with pytest.warns(UserWarning):
12
+ api.sort_file(tmp_file, atomic=True)
0 commit comments