File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414from concurrent .futures import ThreadPoolExecutor
1515from contextlib import contextmanager , redirect_stderr
1616from dataclasses import fields , replace
17+ from importlib .metadata import version as imp_version
1718from io import BytesIO
1819from pathlib import Path , WindowsPath
1920from platform import system
2526import pytest
2627from click import unstyle
2728from click .testing import CliRunner
29+ from packaging .version import Version
2830from pathspec import PathSpec
2931
3032import black
@@ -114,7 +116,10 @@ class BlackRunner(CliRunner):
114116 """Make sure STDOUT and STDERR are kept separate when testing Black via its CLI."""
115117
116118 def __init__ (self ) -> None :
117- super ().__init__ (mix_stderr = False )
119+ if Version (imp_version ("click" )) >= Version ("8.2.0" ):
120+ super ().__init__ ()
121+ else :
122+ super ().__init__ (mix_stderr = False )
118123
119124
120125def invokeBlack (
You can’t perform that action at this time.
0 commit comments