Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix newline after printing "No issues detected" during check mode #53

Merged
merged 2 commits into from
Jun 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autoflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def fix_file(filename, args, standard_out):
standard_out.write(''.join(diff))
else:
if args.check:
standard_out.write('No issues detected!')
standard_out.write('No issues detected!\n')


def open_with_encoding(filename, encoding, mode='r',
Expand Down
4 changes: 2 additions & 2 deletions test_autoflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ def test_check_with_empty_file(self):
autoflake._main(argv=['my_fake_program', '--check', filename],
standard_out=output_file,
standard_error=None)
self.assertEqual('No issues detected!', output_file.getvalue())
self.assertEqual('No issues detected!\n', output_file.getvalue())

def test_check_correct_file(self):
with temporary_file("""\
Expand All @@ -1374,7 +1374,7 @@ def test_check_correct_file(self):
autoflake._main(argv=['my_fake_program', '--check', filename],
standard_out=output_file,
standard_error=None)
self.assertEqual('No issues detected!', output_file.getvalue())
self.assertEqual('No issues detected!\n', output_file.getvalue())

def test_check_useless_pass(self):
with temporary_file("""\
Expand Down