X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/c012c70176e1958d755768893c08f4b0892fb51d..52fda8b0e9e52e94aae6cb3170c9b1b492a2d8b4:/tests/test_black.py?ds=sidebyside diff --git a/tests/test_black.py b/tests/test_black.py index ba834c5..dd3beed 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -200,7 +200,7 @@ class BlackTestCase(unittest.TestCase): self.assertTrue(ff(tmp_file, write_back=black.WriteBack.DIFF)) sys.stdout.seek(0) actual = sys.stdout.read() - actual = actual.replace(tmp_file.name, "") + actual = actual.replace(str(tmp_file), "") finally: sys.stdout = hold_stdout os.unlink(tmp_file) @@ -262,6 +262,14 @@ class BlackTestCase(unittest.TestCase): black.assert_equivalent(source, actual) black.assert_stable(source, actual, line_length=ll) + @patch("black.dump_to_file", dump_to_stderr) + def test_comments5(self) -> None: + source, expected = read_data("comments5") + actual = fs(source) + self.assertFormatEqual(expected, actual) + black.assert_equivalent(source, actual) + black.assert_stable(source, actual, line_length=ll) + @patch("black.dump_to_file", dump_to_stderr) def test_cantfit(self) -> None: source, expected = read_data("cantfit")