X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/e9681a40dcb3d38b56b301d811bb1c55201fd97e..712f8b37fb12a40ec6ea86903f44c2d0750f56a3:/tests/test_black.py?ds=inline diff --git a/tests/test_black.py b/tests/test_black.py index ce7bab2..20cc9f7 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -1256,23 +1256,25 @@ class BlackTestCase(BlackBaseTestCase): def test_shhh_click(self) -> None: try: - from click import _unicodefun + from click import _unicodefun # type: ignore except ImportError: self.skipTest("Incompatible Click version") - if not hasattr(_unicodefun, "_verify_python3_env"): + + if not hasattr(_unicodefun, "_verify_python_env"): self.skipTest("Incompatible Click version") + # First, let's see if Click is crashing with a preferred ASCII charset. with patch("locale.getpreferredencoding") as gpe: gpe.return_value = "ASCII" with self.assertRaises(RuntimeError): - _unicodefun._verify_python3_env() # type: ignore + _unicodefun._verify_python_env() # Now, let's silence Click... black.patch_click() # ...and confirm it's silent. with patch("locale.getpreferredencoding") as gpe: gpe.return_value = "ASCII" try: - _unicodefun._verify_python3_env() # type: ignore + _unicodefun._verify_python_env() except RuntimeError as re: self.fail(f"`patch_click()` failed, exception still raised: {re}")