X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/32dd9ecb2e9dec8b29c07726d5713ed5b4c36547..f3f3acc4440543cd7b8bf7cb4d4cea7300a251ef:/tests/test_black.py diff --git a/tests/test_black.py b/tests/test_black.py index 2dd284f..b04c0a6 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -1198,6 +1198,20 @@ class BlackTestCase(BlackBaseTestCase): ignore_config=True, ) + def test_required_version_matches_partial_version(self) -> None: + self.invokeBlack( + ["--required-version", black.__version__.split(".")[0], "-c", "0"], + exit_code=0, + ignore_config=True, + ) + + def test_required_version_does_not_match_on_minor_version(self) -> None: + self.invokeBlack( + ["--required-version", black.__version__.split(".")[0] + ".999", "-c", "0"], + exit_code=1, + ignore_config=True, + ) + def test_required_version_does_not_match_version(self) -> None: result = BlackRunner().invoke( black.main,