Skip to content

Commit e3461d3

Browse files
committed
chore(test_common): Fix yoda statements repaired by ruff 0.1.9
> 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.
1 parent 9dc1864 commit e3461d3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/legacy_api/test_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi:
4343
assert has_gte_version(TMUX_MIN_VERSION)
4444
assert has_gt_version(TMUX_MAX_VERSION), "Greater than the max-supported version"
4545
assert (
46-
"%s-master" % TMUX_MAX_VERSION == get_version()
46+
get_version() == "%s-master" % TMUX_MAX_VERSION
4747
), "Is the latest supported version with -master appended"
4848

4949

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

8787

tests/test_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi:
4343
assert has_gte_version(TMUX_MIN_VERSION)
4444
assert has_gt_version(TMUX_MAX_VERSION), "Greater than the max-supported version"
4545
assert (
46-
"%s-master" % TMUX_MAX_VERSION == get_version()
46+
get_version() == "%s-master" % TMUX_MAX_VERSION
4747
), "Is the latest supported version with -master appended"
4848

4949

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

8787

0 commit comments

Comments
 (0)