mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Update ruff to 0.9 (#1482)
Some checks are pending
CI / Perform linting checks (3.13) (push) Waiting to run
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.13) (push) Blocked by required conditions
CodeQL checks / Analyze (python) (push) Waiting to run
Some checks are pending
CI / Perform linting checks (3.13) (push) Waiting to run
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.13) (push) Blocked by required conditions
CodeQL checks / Analyze (python) (push) Waiting to run
Ruff 0.9 contains a number of formatter changes for the 2025 style guide. Update to `ruff>=0.9.0` and apply the formatter fixes. https://astral.sh/blog/ruff-v0.9.0
This commit is contained in:
@@ -218,9 +218,9 @@ class FakeSmartCamTransport(BaseTransport):
|
||||
|
||||
@staticmethod
|
||||
def _get_second_key(request_dict: dict[str, Any]) -> str:
|
||||
assert (
|
||||
len(request_dict) == 2
|
||||
), f"Unexpected dict {request_dict}, should be length 2"
|
||||
assert len(request_dict) == 2, (
|
||||
f"Unexpected dict {request_dict}, should be length 2"
|
||||
)
|
||||
it = iter(request_dict)
|
||||
next(it, None)
|
||||
return next(it)
|
||||
|
@@ -223,9 +223,9 @@ async def test_update_module_update_delays(
|
||||
now if mod_delay == 0 else now - (seconds % mod_delay)
|
||||
)
|
||||
|
||||
assert (
|
||||
module._last_update_time == expected_update_time
|
||||
), f"Expected update time {expected_update_time} after {seconds} seconds for {module.name} with delay {mod_delay} got {module._last_update_time}"
|
||||
assert module._last_update_time == expected_update_time, (
|
||||
f"Expected update time {expected_update_time} after {seconds} seconds for {module.name} with delay {mod_delay} got {module._last_update_time}"
|
||||
)
|
||||
|
||||
|
||||
async def _get_child_responses(child_requests: list[dict[str, Any]], child_protocol):
|
||||
|
@@ -653,8 +653,7 @@ async def test_light_preset(dev: Device, runner: CliRunner):
|
||||
|
||||
if len(light_preset.preset_states_list) == 0:
|
||||
pytest.skip(
|
||||
"Some fixtures do not have presets and"
|
||||
" the api doesn'tsupport creating them"
|
||||
"Some fixtures do not have presets and the api doesn'tsupport creating them"
|
||||
)
|
||||
# Start off with a known state
|
||||
first_name = light_preset.preset_list[1]
|
||||
|
@@ -56,7 +56,7 @@ def test_encrypt():
|
||||
|
||||
|
||||
status_parameters = pytest.mark.parametrize(
|
||||
"status_code, error_code, inner_error_code, expectation",
|
||||
("status_code", "error_code", "inner_error_code", "expectation"),
|
||||
[
|
||||
(200, 0, 0, does_not_raise()),
|
||||
(400, 0, 0, pytest.raises(KasaException)),
|
||||
|
@@ -273,7 +273,7 @@ async def test_unencrypted_passthrough_errors(mocker, caplog, want_default):
|
||||
aiohttp.ClientSession, "post", side_effect=mock_ssl_aes_device.post
|
||||
)
|
||||
|
||||
msg = f"{host} responded with an unexpected " f"status code 401 to handshake1"
|
||||
msg = f"{host} responded with an unexpected status code 401 to handshake1"
|
||||
with pytest.raises(KasaException, match=msg):
|
||||
await transport.send(json_dumps(request))
|
||||
|
||||
@@ -288,7 +288,7 @@ async def test_unencrypted_passthrough_errors(mocker, caplog, want_default):
|
||||
aiohttp.ClientSession, "post", side_effect=mock_ssl_aes_device.post
|
||||
)
|
||||
|
||||
msg = f"{host} responded with an unexpected " f"status code 401 to login"
|
||||
msg = f"{host} responded with an unexpected status code 401 to login"
|
||||
with pytest.raises(KasaException, match=msg):
|
||||
await transport.send(json_dumps(request))
|
||||
|
||||
@@ -303,7 +303,7 @@ async def test_unencrypted_passthrough_errors(mocker, caplog, want_default):
|
||||
aiohttp.ClientSession, "post", side_effect=mock_ssl_aes_device.post
|
||||
)
|
||||
|
||||
msg = f"{host} responded with an unexpected " f"status code 401 to unencrypted send"
|
||||
msg = f"{host} responded with an unexpected status code 401 to unencrypted send"
|
||||
with pytest.raises(KasaException, match=msg):
|
||||
await transport.send(json_dumps(request))
|
||||
|
||||
|
Reference in New Issue
Block a user