From da7cd5d5f7b073eab6326dc868dff5410c66f49e Mon Sep 17 00:00:00 2001 From: Patrick Ogenstad Date: Tue, 15 Oct 2024 22:06:55 +0200 Subject: [PATCH] Activate rule for B018 for useless attribute access --- pyproject.toml | 1 - tests/unit/sdk/test_node.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7e282500..5852b567 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -245,7 +245,6 @@ ignore = [ "B007", # Loop control variable `result` not used within loop body "B008", # Do not perform function call `typer.Option` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable "B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling - "B018", # Found useless attribute access. Either assign it to a variable or remove it. "C408", # Unnecessary `dict` call (rewrite as a literal) "C414", # Unnecessary `list` call within `sorted()` "FURB110", # Replace ternary `if` expression with `or` operator diff --git a/tests/unit/sdk/test_node.py b/tests/unit/sdk/test_node.py index 5749052d..12ab305b 100644 --- a/tests/unit/sdk/test_node.py +++ b/tests/unit/sdk/test_node.py @@ -1309,10 +1309,10 @@ async def test_node_get_relationship_not_in_store(client, location_schema, locat node = InfrahubNodeSync(client=client, schema=location_schema, data=location_data01) with pytest.raises(NodeNotFoundError): - node.primary_tag.peer # pylint: disable=pointless-statement + _ = node.primary_tag.peer with pytest.raises(NodeNotFoundError): - node.tags[0].peer # pylint: disable=pointless-statement + _ = node.tags[0].peer @pytest.mark.parametrize("client_type", client_types)