Skip to content

Commit 94762ce

Browse files
Add test case for new error based approach
1 parent 8cce4dd commit 94762ce

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

isort/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ def main(argv: Optional[Sequence[str]] = None, stdin: Optional[TextIOWrapper] =
886886
)
887887
print(f"Skipped {num_skipped} files")
888888

889-
if not config.quiet and (remapped_deprecated_args or deprecated_flags): # pragma: no cover
889+
if not config.quiet and (remapped_deprecated_args or deprecated_flags):
890890
if remapped_deprecated_args:
891891
warn(
892892
"W0502: The following deprecated single dash CLI flags were used and translated: "

tests/test_main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ def test_main(capsys, tmpdir):
231231
out, error = capsys.readouterr()
232232
assert "Skipped" in out
233233

234+
# warnings should be displayed if old flags are used
235+
with pytest.warns(UserWarning):
236+
main.main([str(python_file), "--recursive", "-fss"])
237+
234238

235239
def test_isort_command():
236240
"""Ensure ISortCommand got registered, otherwise setuptools error must have occured"""

0 commit comments

Comments
 (0)