X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/104aec555fae0883ef5b53709569bd9c4d420bc5..366a0806eb4edd94d4d20cc6912333586bdc9fa7:/tests/test_black.py?ds=inline diff --git a/tests/test_black.py b/tests/test_black.py index 5c72050..8a37f7c 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -26,6 +26,7 @@ from typing import ( import pytest import unittest from unittest.mock import patch, MagicMock +from parameterized import parameterized import click from click import unstyle @@ -299,6 +300,14 @@ class BlackTestCase(BlackBaseTestCase): versions = black.detect_target_versions(root) self.assertIn(black.TargetVersion.PY38, versions) + @parameterized.expand([(3, 9), (3, 10)]) + def test_pep_572_newer_syntax(self, major: int, minor: int) -> None: + source, expected = read_data(f"pep_572_py{major}{minor}") + actual = fs(source, mode=DEFAULT_MODE) + self.assertFormatEqual(expected, actual) + if sys.version_info >= (major, minor): + black.assert_equivalent(source, actual) + def test_expression_ff(self) -> None: source, expected = read_data("expression") tmp_file = Path(black.dump_to_file(source))