@@ -66,7 +66,7 @@ def test_sort_imports_error_handling(tmpdir, capsys):
66
66
):
67
67
main .sort_imports (str (tmp_file ), DEFAULT_CONFIG , check = True ).incorrectly_sorted # type: ignore # noqa
68
68
69
- out , error = capsys .readouterr ()
69
+ _ , error = capsys .readouterr ()
70
70
assert "Unrecoverable exception thrown when parsing" in error
71
71
72
72
@@ -189,16 +189,19 @@ def test_main(capsys, tmpdir):
189
189
assert returned_config ["virtual_env" ] == str (tmpdir )
190
190
191
191
# This should work even if settings path is not provided
192
- main .main (base_args [2 :] + [ "--show-config" ])
192
+ main .main ([ * base_args [2 :], "--show-config" ])
193
193
out , error = capsys .readouterr ()
194
194
assert json .loads (out )["virtual_env" ] == str (tmpdir )
195
195
196
196
# This should raise an error if an invalid settings path is provided
197
197
with pytest .raises (InvalidSettingsPath ):
198
198
main .main (
199
- base_args [2 :]
200
- + ["--show-config" ]
201
- + ["--settings-path" , "/random-root-folder-that-cant-exist-right?" ]
199
+ [
200
+ * base_args [2 :],
201
+ "--show-config" ,
202
+ "--settings-path" ,
203
+ "/random-root-folder-that-cant-exist-right?" ,
204
+ ]
202
205
)
203
206
204
207
# Should be able to set settings path to a file
@@ -894,7 +897,7 @@ def test_unsupported_encodings(tmpdir, capsys):
894
897
# should throw an error if only unsupported encoding provided
895
898
with pytest .raises (SystemExit ):
896
899
main .main ([str (tmp_file )])
897
- out , error = capsys .readouterr ()
900
+ _ , error = capsys .readouterr ()
898
901
899
902
assert "No valid encodings." in error
900
903
@@ -903,7 +906,7 @@ def test_unsupported_encodings(tmpdir, capsys):
903
906
normal_file .write ("import os\n import sys" )
904
907
905
908
main .main ([str (tmp_file ), str (normal_file ), "--verbose" ])
906
- out , error = capsys .readouterr ()
909
+ _ , error = capsys .readouterr ()
907
910
908
911
909
912
def test_stream_skip_file (tmpdir , capsys ):
@@ -914,13 +917,13 @@ def test_stream_skip_file(tmpdir, capsys):
914
917
"""
915
918
stream_with_skip = as_stream (input_with_skip )
916
919
main .main (["-" ], stdin = stream_with_skip )
917
- out , error = capsys .readouterr ()
920
+ out , _ = capsys .readouterr ()
918
921
assert out == input_with_skip
919
922
920
923
input_without_skip = input_with_skip .replace ("isort: skip_file" , "generic comment" )
921
924
stream_without_skip = as_stream (input_without_skip )
922
925
main .main (["-" ], stdin = stream_without_skip )
923
- out , error = capsys .readouterr ()
926
+ out , _ = capsys .readouterr ()
924
927
assert (
925
928
out
926
929
== """
@@ -933,7 +936,7 @@ def test_stream_skip_file(tmpdir, capsys):
933
936
atomic_input_without_skip = input_with_skip .replace ("isort: skip_file" , "generic comment" )
934
937
stream_without_skip = as_stream (atomic_input_without_skip )
935
938
main .main (["-" , "--atomic" ], stdin = stream_without_skip )
936
- out , error = capsys .readouterr ()
939
+ out , _ = capsys .readouterr ()
937
940
assert (
938
941
out
939
942
== """
0 commit comments