Skip to content

Commit

Permalink
pre-commit: update and fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Feb 22, 2024
1 parent dbd3b4c commit 70a59af
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
repos:
- repo: https://github.com/ambv/black
rev: 22.12.0
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [ flake8-bugbear ]
- repo: https://github.com/timothycrosley/isort
rev: 5.11.4
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
10 changes: 6 additions & 4 deletions src/aiographql/client/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ def __post_init__(
object.__setattr__(
self,
"request",
GraphQLRequest(query=self.request)
if isinstance(self.request, str)
else self.request.copy(
headers=headers, operation=operation, variables=variables
(
GraphQLRequest(query=self.request)
if isinstance(self.request, str)
else self.request.copy(
headers=headers, operation=operation, variables=variables
)
),
)
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ def city_name():

@pytest.fixture
def subscription_query(city_name):
# noqa: B907
return f"""
subscription {{
city(where: {{name: {{_eq: "{city_name}"}}}}) {{
city(where: {{name: {{_eq: "{city_name!r}"}}}}) {{
name
id
}}
Expand Down Expand Up @@ -110,14 +111,14 @@ async def mutation_city(client, headers, city_name):
affected_rows
}}
}}
"""
""" # noqa: B907
delete_mutation = f"""
mutation {{
delete_city(where: {{name: {{_eq: "{city_name}"}}}}) {{
affected_rows
}}
}}
"""
""" # noqa: B907
request = GraphQLRequest(query=delete_mutation)
_ = await client.query(request=request, headers=headers)

Expand Down
5 changes: 1 addition & 4 deletions tests/test_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,4 @@ async def test_post_headers(server, headers, client, query_city):
async def test_no_headers(server, client, query_city):
graphql_request = GraphQLRequest(query=query_city)
with pytest.raises(GraphQLIntrospectionException):
response = await client.post(graphql_request)
assert isinstance(response, GraphQLResponse)
assert not response.data
assert response.errors
await client.post(graphql_request)

0 comments on commit 70a59af

Please sign in to comment.