From e3461d36f870b00f5adafb7f9c4bec0f95a5ddb7 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Thu, 21 Dec 2023 14:48:57 -0600 Subject: [PATCH] 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. --- tests/legacy_api/test_common.py | 4 ++-- tests/test_common.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/legacy_api/test_common.py b/tests/legacy_api/test_common.py index 1cd62c6f3..9067ac2bb 100644 --- a/tests/legacy_api/test_common.py +++ b/tests/legacy_api/test_common.py @@ -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" @@ -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" diff --git a/tests/test_common.py b/tests/test_common.py index 1cd62c6f3..9067ac2bb 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -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" @@ -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"