Merge pull request 'ruff: Fix upcoming ruff lints' (#5790) from ke-upcoming-ruff-lints into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5790
This commit is contained in:
Kenji Berthold
2025-11-11 10:28:52 +00:00
6 changed files with 7 additions and 7 deletions

View File

@@ -501,7 +501,7 @@ def setup_filesystems(container: ContainerInfo) -> None:
if file.is_symlink(): if file.is_symlink():
target = file.readlink() target = file.readlink()
sym = container.nix_store_dir / file.name sym = container.nix_store_dir / file.name
os.symlink(target, sym) sym.symlink_to(target)
# Read /proc/mounts and replicate every bind mount # Read /proc/mounts and replicate every bind mount
with Path("/proc/self/mounts").open() as f: with Path("/proc/self/mounts").open() as f:

View File

@@ -94,7 +94,7 @@ class TestHttpBridge:
def test_http_bridge_middleware_setup(self, http_bridge: tuple) -> None: def test_http_bridge_middleware_setup(self, http_bridge: tuple) -> None:
"""Test that middleware is properly set up.""" """Test that middleware is properly set up."""
api, middleware_chain = http_bridge _api, middleware_chain = http_bridge
# Test that we can create the bridge with middleware # Test that we can create the bridge with middleware
# The actual HTTP handling will be tested through the server integration tests # The actual HTTP handling will be tested through the server integration tests

View File

@@ -144,7 +144,7 @@ def test_machine_delete(
) -> None: ) -> None:
flake = flake_with_sops flake = flake_with_sops
admin_key, machine_key, machine2_key, *xs = sops_setup.keys admin_key, machine_key, machine2_key, *_xs = sops_setup.keys
# create a couple machines with their keys # create a couple machines with their keys
for name, key in (("my-machine", machine_key), ("my-machine2", machine2_key)): for name, key in (("my-machine", machine_key), ("my-machine2", machine2_key)):

View File

@@ -1440,7 +1440,7 @@ def test_shared_generator_conflicting_definition_raises_error(
# because they have conflicting definitions for the same shared generator # because they have conflicting definitions for the same shared generator
with pytest.raises( with pytest.raises(
ClanError, ClanError,
match=".*differ.*", match=r".*differ.*",
): ):
cli.run(["vars", "generate", "--flake", str(flake.path)]) cli.run(["vars", "generate", "--flake", str(flake.path)])

View File

@@ -842,7 +842,7 @@ class TestGetLlmFinalDecision:
): ):
mock_agg.return_value = MagicMock(tools=[mock_schema]) mock_agg.return_value = MagicMock(tools=[mock_schema])
function_call_results, message = get_llm_final_decision( function_call_results, _message = get_llm_final_decision(
user_request="okay then gchq-local as controller and qube-email as moon please everything else as peer", user_request="okay then gchq-local as controller and qube-email as moon please everything else as peer",
flake=mock_flake, flake=mock_flake,
selected_service="zerotier", selected_service="zerotier",

View File

@@ -216,7 +216,7 @@ class TestLogFileCreation:
configured_log_manager: LogManager, configured_log_manager: LogManager,
) -> None: ) -> None:
"""Test that creating log file with unregistered group fails.""" """Test that creating log file with unregistered group fails."""
with pytest.raises(ValueError, match="Group structure.*is not valid"): with pytest.raises(ValueError, match=r"Group structure.*is not valid"):
configured_log_manager.create_log_file( configured_log_manager.create_log_file(
example_function, example_function,
"test_op", "test_op",
@@ -228,7 +228,7 @@ class TestLogFileCreation:
configured_log_manager: LogManager, configured_log_manager: LogManager,
) -> None: ) -> None:
"""Test that invalid nested structure fails.""" """Test that invalid nested structure fails."""
with pytest.raises(ValueError, match="Group structure.*is not valid"): with pytest.raises(ValueError, match=r"Group structure.*is not valid"):
configured_log_manager.create_log_file( configured_log_manager.create_log_file(
example_function, example_function,
"test_op", "test_op",