X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/7914a5b0a228fa57e060b79c75d970cc48c7e914..8de552eb4f0fbf1ad84812cde71489cc00d3ed1f:/tests/test_black.py?ds=sidebyside diff --git a/tests/test_black.py b/tests/test_black.py index ec7a883..69746d1 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -205,7 +205,10 @@ class BlackTestCase(unittest.TestCase): self.assertEqual( unstyle(str(report)), '1 file reformatted, 1 file left unchanged.' ) + self.assertEqual(report.return_code, 0) + report.check = True self.assertEqual(report.return_code, 1) + report.check = False report.failed(Path('e1'), 'boom') self.assertEqual(len(out_lines), 2) self.assertEqual(len(err_lines), 1) @@ -246,6 +249,12 @@ class BlackTestCase(unittest.TestCase): '2 files failed to reformat.', ) self.assertEqual(report.return_code, 123) + report.check = True + self.assertEqual( + unstyle(str(report)), + '2 files would be reformatted, 2 files would be left unchanged, ' + '2 files would fail to reformat.', + ) def test_is_python36(self) -> None: node = black.lib2to3_parse("def f(*, arg): ...\n")