@@ -66,32 +66,38 @@ def test_mixed_no_newline_end_of_file(tmpdir):
6666 ('--fix=lf' , b'foo\n bar\n baz\n ' ),
6767 ),
6868)
69- def test_line_endings_ok (fix_option , input_s , tmpdir ):
69+ def test_line_endings_ok (fix_option , input_s , tmpdir , capsys ):
7070 path = tmpdir .join ('input.txt' )
7171 path .write_binary (input_s )
7272 ret = main ((fix_option , path .strpath ))
7373
7474 assert ret == 0
7575 assert path .read_binary () == input_s
76+ out , _ = capsys .readouterr ()
77+ assert out == ''
7678
7779
78- def test_no_fix_does_not_modify (tmpdir ):
80+ def test_no_fix_does_not_modify (tmpdir , capsys ):
7981 path = tmpdir .join ('input.txt' )
8082 contents = b'foo\r \n bar\r baz\n womp\n '
8183 path .write_binary (contents )
8284 ret = main (('--fix=no' , path .strpath ))
8385
8486 assert ret == 1
8587 assert path .read_binary () == contents
88+ out , _ = capsys .readouterr ()
89+ assert out == '{}: mixed line endings\n ' .format (path )
8690
8791
88- def test_fix_lf (tmpdir ):
92+ def test_fix_lf (tmpdir , capsys ):
8993 path = tmpdir .join ('input.txt' )
9094 path .write_binary (b'foo\r \n bar\r baz\n ' )
9195 ret = main (('--fix=lf' , path .strpath ))
9296
9397 assert ret == 1
9498 assert path .read_binary () == b'foo\n bar\n baz\n '
99+ out , _ = capsys .readouterr ()
100+ assert out == '{}: fixed mixed line endings\n ' .format (path )
95101
96102
97103def test_fix_crlf (tmpdir ):
0 commit comments