Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion robotidy/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.17.0"
__version__ = "4.18.0"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
python_requires=">=3.8",
install_requires=[
"robotframework>=4.0",
"click==8.1.*",
"click>=8.1",
"colorama>=0.4.3",
"pathspec>=0.9.0",
"tomli>=2.0",
Expand Down
6 changes: 3 additions & 3 deletions tests/atest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
from pathlib import Path

import pytest
from click.testing import CliRunner
from packaging import version
from packaging.specifiers import SpecifierSet
from rich.console import Console
from robot.version import VERSION as RF_VERSION

from robotidy.cli import cli
from robotidy.utils.misc import decorate_diff_with_color
from tests.utils import cli_runner

VERSION_MATRIX = {"ReplaceReturns": 5, "InlineIf": 5, "ReplaceBreakContinue": 5, "Translate": 6, "ReplaceWithVAR": 7}
ROBOT_VERSION = version.parse(RF_VERSION)
Expand Down Expand Up @@ -75,7 +75,7 @@ def run_tidy(
):
if not self.enabled_in_version(target_version):
pytest.skip(f"Test enabled only for RF {target_version}")
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
output_path = str(self.TRANSFORMERS_DIR / "actual" / source)
arguments = ["--output", output_path]
if not_modified:
Expand Down Expand Up @@ -117,7 +117,7 @@ class MultipleConfigsTest:
ROOT_DIR = Path(__file__).parent / "configuration_files"

def run_tidy(self, tmpdir, args: list[str] | None = None, exit_code: int = 0, not_modified: bool = False):
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
temporary_dir = tmpdir / self.TEST_DIR
shutil.copytree(self.ROOT_DIR / self.TEST_DIR / "source", temporary_dir)
arguments = []
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/test_transform_stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from pathlib import Path

import pytest
from click.testing import CliRunner

from robotidy.cli import cli
from robotidy.transformers import TransformConfigMap, load_transformers
from robotidy.utils.misc import ROBOT_VERSION
from tests.utils import cli_runner

RERUN_NEEDED_4 = {
"RenameKeywords": {"run_keywords": 2, "disablers": 2},
Expand Down Expand Up @@ -78,7 +78,7 @@
def run_tidy(cmd, enable_disabled: bool):
if enable_disabled:
cmd = get_enable_disabled_config() + cmd
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
return runner.invoke(cli, cmd)


Expand Down
5 changes: 2 additions & 3 deletions tests/utest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

from pathlib import Path

from click.testing import CliRunner

from robotidy.cli import cli
from tests.utils import cli_runner


def run_tidy(
Expand All @@ -14,7 +13,7 @@ def run_tidy(
std_in: str | None = None,
overwrite_input: bool = False,
):
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
arguments = args if args is not None else []
if not overwrite_input:
if output:
Expand Down
8 changes: 8 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from click.testing import CliRunner


def cli_runner():
try:
return CliRunner(mix_stderr=False)
except TypeError:
return CliRunner()