Skip to content

Commit 14e1de8

Browse files
authored
mix_stderr parameter was removed from click 8.2.0 (psf#4577)
1 parent 5f23701 commit 14e1de8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_black.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from concurrent.futures import ThreadPoolExecutor
1515
from contextlib import contextmanager, redirect_stderr
1616
from dataclasses import fields, replace
17+
from importlib.metadata import version as imp_version
1718
from io import BytesIO
1819
from pathlib import Path, WindowsPath
1920
from platform import system
@@ -25,6 +26,7 @@
2526
import pytest
2627
from click import unstyle
2728
from click.testing import CliRunner
29+
from packaging.version import Version
2830
from pathspec import PathSpec
2931

3032
import 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

120125
def invokeBlack(

0 commit comments

Comments
 (0)