Skip to content

Commit

Permalink
Fix tests to work with errors in stderr instead of stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
bhirsz committed May 7, 2024
1 parent 7334183 commit 16a0df6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/utest/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def test_list_transformers_filter_disabled(self, flag):
def test_list_transformers_invalid_filter_value(self, flag):
cmd = [flag, "RenameKeywords"]
result = run_tidy(cmd, exit_code=2)
error = self.normalize_cli_error(result.output)
error = self.normalize_cli_error(result.stderr)
assert (
"Invalid value for '--list' / '-l': Not allowed value. Allowed values are: all, enabled, disabled"
) in error
Expand Down Expand Up @@ -486,7 +486,7 @@ def test_loading_from_stdin(self):
def test_invalid_target_version(self, mocked_version, target_version):
mocked_version.major = 5
result = run_tidy(f"--target-version {target_version} .".split(), exit_code=2)
error = self.normalize_cli_error(result.output)
error = self.normalize_cli_error(result.stderr)
assert f"Invalid value for '--target-version' / '-tv':" in error

def normalize_cli_error(self, error):
Expand All @@ -500,7 +500,7 @@ def test_too_recent_target_version(self, mocked_version, option_name):
target_version = 5
mocked_version.major = 4
result = run_tidy(f"{option_name} rf{target_version} .".split(), exit_code=2)
error = self.normalize_cli_error(result.output)
error = self.normalize_cli_error(result.stderr)
assert (
"Invalid value for '--target-version' / '-tv': "
f"Target Robot Framework version ({target_version}) "
Expand Down

0 comments on commit 16a0df6

Please sign in to comment.