|
6 | 6 | from pathlib import Path |
7 | 7 |
|
8 | 8 | import pytest |
9 | | -from click.testing import CliRunner |
10 | 9 | from packaging import version |
11 | 10 | from packaging.specifiers import SpecifierSet |
12 | 11 | from rich.console import Console |
13 | 12 | from robot.version import VERSION as RF_VERSION |
14 | 13 |
|
15 | 14 | from robotidy.cli import cli |
16 | 15 | from robotidy.utils.misc import decorate_diff_with_color |
| 16 | +from tests.utils import cli_runner |
17 | 17 |
|
18 | 18 | VERSION_MATRIX = {"ReplaceReturns": 5, "InlineIf": 5, "ReplaceBreakContinue": 5, "Translate": 6, "ReplaceWithVAR": 7} |
19 | 19 | ROBOT_VERSION = version.parse(RF_VERSION) |
@@ -75,7 +75,7 @@ def run_tidy( |
75 | 75 | ): |
76 | 76 | if not self.enabled_in_version(target_version): |
77 | 77 | pytest.skip(f"Test enabled only for RF {target_version}") |
78 | | - runner = CliRunner(mix_stderr=False) |
| 78 | + runner = cli_runner() |
79 | 79 | output_path = str(self.TRANSFORMERS_DIR / "actual" / source) |
80 | 80 | arguments = ["--output", output_path] |
81 | 81 | if not_modified: |
@@ -117,7 +117,7 @@ class MultipleConfigsTest: |
117 | 117 | ROOT_DIR = Path(__file__).parent / "configuration_files" |
118 | 118 |
|
119 | 119 | def run_tidy(self, tmpdir, args: list[str] | None = None, exit_code: int = 0, not_modified: bool = False): |
120 | | - runner = CliRunner(mix_stderr=False) |
| 120 | + runner = cli_runner() |
121 | 121 | temporary_dir = tmpdir / self.TEST_DIR |
122 | 122 | shutil.copytree(self.ROOT_DIR / self.TEST_DIR / "source", temporary_dir) |
123 | 123 | arguments = [] |
|
0 commit comments