X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a82f1867875c906bedfe3ef675473b795d8b0440..8d588273766675ece744f9b37c40483706f3a9d7:/tests/test_black.py diff --git a/tests/test_black.py b/tests/test_black.py index 6eaca98..30bb6fd 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -410,6 +410,17 @@ 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_numeric_literals_ignoring_underscores(self) -> None: + source, expected = read_data("numeric_literals_skip_underscores") + mode = ( + black.FileMode.PYTHON36 | black.FileMode.NO_NUMERIC_UNDERSCORE_NORMALIZATION + ) + actual = fs(source, mode=mode) + self.assertFormatEqual(expected, actual) + black.assert_equivalent(source, actual) + black.assert_stable(source, actual, line_length=ll, mode=mode) + @patch("black.dump_to_file", dump_to_stderr) def test_numeric_literals_py2(self) -> None: source, expected = read_data("numeric_literals_py2") @@ -1280,7 +1291,7 @@ class BlackTestCase(unittest.TestCase): try: list(black.gen_python_files_in_dir(path, root, include, exclude, report)) except ValueError as ve: - self.fail("`get_python_files_in_dir()` failed: {ve}") + self.fail(f"`get_python_files_in_dir()` failed: {ve}") path.iterdir.assert_called_once() child.resolve.assert_called_once() child.is_symlink.assert_called_once()