Skip to content

Commit

Permalink
chore(test_common): Fix yoda statements repaired by ruff 0.1.9
Browse files Browse the repository at this point in the history
> ruff . --fix
tests/legacy_api/test_common.py:46:9: SIM300 [*] Yoda conditions are discouraged, use `get_version() == "%s-master" % TMUX_MAX_VERSION` instead
tests/legacy_api/test_common.py:84:9: SIM300 [*] Yoda conditions are discouraged, use `get_version() == "%s-openbsd" % TMUX_MAX_VERSION` instead
tests/test_common.py:46:9: SIM300 [*] Yoda conditions are discouraged, use `get_version() == "%s-master" % TMUX_MAX_VERSION` instead
tests/test_common.py:84:9: SIM300 [*] Yoda conditions are discouraged, use `get_version() == "%s-openbsd" % TMUX_MAX_VERSION` instead
Found 4 errors.
[*] 4 fixable with the `--fix` option.
  • Loading branch information
tony committed Dec 21, 2023
1 parent 9dc1864 commit e3461d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/legacy_api/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi:
assert has_gte_version(TMUX_MIN_VERSION)
assert has_gt_version(TMUX_MAX_VERSION), "Greater than the max-supported version"
assert (
"%s-master" % TMUX_MAX_VERSION == get_version()
get_version() == "%s-master" % TMUX_MAX_VERSION
), "Is the latest supported version with -master appended"


Expand Down Expand Up @@ -81,7 +81,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi:
assert has_gte_version(TMUX_MIN_VERSION)
assert has_gt_version(TMUX_MAX_VERSION), "Greater than the max-supported version"
assert (
"%s-openbsd" % TMUX_MAX_VERSION == get_version()
get_version() == "%s-openbsd" % TMUX_MAX_VERSION
), "Is the latest supported version with -openbsd appended"


Expand Down
4 changes: 2 additions & 2 deletions tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi:
assert has_gte_version(TMUX_MIN_VERSION)
assert has_gt_version(TMUX_MAX_VERSION), "Greater than the max-supported version"
assert (
"%s-master" % TMUX_MAX_VERSION == get_version()
get_version() == "%s-master" % TMUX_MAX_VERSION
), "Is the latest supported version with -master appended"


Expand Down Expand Up @@ -81,7 +81,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi:
assert has_gte_version(TMUX_MIN_VERSION)
assert has_gt_version(TMUX_MAX_VERSION), "Greater than the max-supported version"
assert (
"%s-openbsd" % TMUX_MAX_VERSION == get_version()
get_version() == "%s-openbsd" % TMUX_MAX_VERSION
), "Is the latest supported version with -openbsd appended"


Expand Down

0 comments on commit e3461d3

Please sign in to comment.