X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a82f1867875c906bedfe3ef675473b795d8b0440..0c5c5374313566dd9047c3e992a3c23a7ea4b8f2:/tests/test_black.py diff --git a/tests/test_black.py b/tests/test_black.py index 6eaca98..6ff5840 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")