Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cutoffthetop committed Nov 8, 2024
1 parent 82e6762 commit d7fa486
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ select = ["ALL"]
"scripts/**" = [
"INP001", # Scripts folder does not need to be a package
]
"**/main.py" = [
"N803", # Allow dromedaryCase query parameters
]
"tests/**" = [
"ARG005", # Allow unused lambda arguments for mocking
"D101", # Allow missing docstring in public class
Expand Down
4 changes: 2 additions & 2 deletions tests/auxiliary/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def mocked_init(self: WikidataQueryServiceConnector) -> None:
# mock search_wikidata_with_query

def get_data_by_query(
self: WikidataQueryServiceConnector, query: str
_self: WikidataQueryServiceConnector, _query: str
) -> list[dict[str, dict[str, str]]]:
return [
{
Expand Down Expand Up @@ -63,7 +63,7 @@ def get_data_by_query(
wikidata_organization_raw = json.load(fh)

def get_wikidata_item_details_by_id(
self: WikidataQueryServiceConnector, item_id: str
_self: WikidataQueryServiceConnector, _item_id: str
) -> dict[str, str]:
return wikidata_organization_raw

Expand Down
2 changes: 1 addition & 1 deletion tests/identity/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def test_assign_identity(
],
ids=["nothing found", "one item", "two items"],
)
def test_fetch_identities_mocked(
def test_fetch_identities_mocked( # noqa: PLR0913
mocked_graph: MockedGraph,
mocked_return: list[dict[str, str]],
had_primary_source: MergedPrimarySourceIdentifier | None,
Expand Down
8 changes: 4 additions & 4 deletions tests/merged/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ def test_create_merged_item(
extracted_items,
rule_set,
)
except Exception as error:
assert str(expected) in str(error)
except Exception as error: # noqa: BLE001
assert str(expected) in str(error) # noqa: PT017
else:
assert merged_item.model_dump(exclude_defaults=True) == expected

Expand Down Expand Up @@ -462,7 +462,7 @@ def test_search_merged_items_in_graph_mocked(

try:
merged_result = search_merged_items_in_graph(stable_target_id="bFQoRhcVH5DHUB")
except Exception as error:
assert str(expected) in str(error), error
except Exception as error: # noqa: BLE001
assert str(expected) in str(error) # noqa: PT017
else:
assert merged_result.model_dump(exclude_defaults=True) == expected
4 changes: 2 additions & 2 deletions tests/rules/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_transform_raw_rules_to_rule_set_response(
) -> None:
try:
rule_set = transform_raw_rules_to_rule_set_response(items)
except Exception as error:
assert str(expected) in str(error)
except Exception as error: # noqa: BLE001
assert str(expected) in str(error) # noqa: PT017
else:
assert rule_set.model_dump() == expected

0 comments on commit d7fa486

Please sign in to comment.