Skip to content

Commit b2347f4

Browse files
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
1 parent f14ddd7 commit b2347f4

File tree

7 files changed

+32
-34
lines changed

7 files changed

+32
-34
lines changed

sqlmodel/main.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,15 @@ def __init__(self, default: Any = Undefined, **kwargs: Any) -> None:
134134
)
135135
if primary_key is not Undefined:
136136
raise RuntimeError(
137-
"Passing primary_key is not supported when "
138-
"also passing a sa_column"
137+
"Passing primary_key is not supported when also passing a sa_column"
139138
)
140139
if nullable is not Undefined:
141140
raise RuntimeError(
142141
"Passing nullable is not supported when also passing a sa_column"
143142
)
144143
if foreign_key is not Undefined:
145144
raise RuntimeError(
146-
"Passing foreign_key is not supported when "
147-
"also passing a sa_column"
145+
"Passing foreign_key is not supported when also passing a sa_column"
148146
)
149147
if ondelete is not Undefined:
150148
raise RuntimeError(

tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ def test_tutorial(clear_sqlmodel):
4949
data = response.json()
5050
assert response.status_code == 200, response.text
5151
assert data["name"] == hero2_data["name"], "The name should not be set to none"
52-
assert (
53-
data["secret_name"] == "Spider-Youngster"
54-
), "The secret name should be updated"
52+
assert data["secret_name"] == "Spider-Youngster", (
53+
"The secret name should be updated"
54+
)
5555

5656
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
5757
data = response.json()
5858
assert response.status_code == 200, response.text
5959
assert data["name"] == hero3_data["name"]
6060
assert data["age"] is None, (
61-
"A field should be updatable to None, even if " "that's the default"
61+
"A field should be updatable to None, even if that's the default"
6262
)
6363

6464
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})

tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ def test_tutorial(clear_sqlmodel):
5252
data = response.json()
5353
assert response.status_code == 200, response.text
5454
assert data["name"] == hero2_data["name"], "The name should not be set to none"
55-
assert (
56-
data["secret_name"] == "Spider-Youngster"
57-
), "The secret name should be updated"
55+
assert data["secret_name"] == "Spider-Youngster", (
56+
"The secret name should be updated"
57+
)
5858

5959
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
6060
data = response.json()
6161
assert response.status_code == 200, response.text
6262
assert data["name"] == hero3_data["name"]
6363
assert data["age"] is None, (
64-
"A field should be updatable to None, even if " "that's the default"
64+
"A field should be updatable to None, even if that's the default"
6565
)
6666

6767
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})

tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ def test_tutorial(clear_sqlmodel):
5252
data = response.json()
5353
assert response.status_code == 200, response.text
5454
assert data["name"] == hero2_data["name"], "The name should not be set to none"
55-
assert (
56-
data["secret_name"] == "Spider-Youngster"
57-
), "The secret name should be updated"
55+
assert data["secret_name"] == "Spider-Youngster", (
56+
"The secret name should be updated"
57+
)
5858

5959
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
6060
data = response.json()
6161
assert response.status_code == 200, response.text
6262
assert data["name"] == hero3_data["name"]
6363
assert data["age"] is None, (
64-
"A field should be updatable to None, even if " "that's the default"
64+
"A field should be updatable to None, even if that's the default"
6565
)
6666

6767
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})

tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ def test_tutorial(clear_sqlmodel):
8080
data = response.json()
8181
assert response.status_code == 200, response.text
8282
assert data["name"] == hero2_data["name"], "The name should not be set to none"
83-
assert (
84-
data["secret_name"] == "Spider-Youngster"
85-
), "The secret name should be updated"
83+
assert data["secret_name"] == "Spider-Youngster", (
84+
"The secret name should be updated"
85+
)
8686
assert "password" not in data
8787
assert "hashed_password" not in data
8888
with Session(mod.engine) as session:
@@ -95,9 +95,9 @@ def test_tutorial(clear_sqlmodel):
9595
data = response.json()
9696
assert response.status_code == 200, response.text
9797
assert data["name"] == hero3_data["name"]
98-
assert (
99-
data["age"] is None
100-
), "A field should be updatable to None, even if that's the default"
98+
assert data["age"] is None, (
99+
"A field should be updatable to None, even if that's the default"
100+
)
101101
assert "password" not in data
102102
assert "hashed_password" not in data
103103
with Session(mod.engine) as session:

tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel):
8383
data = response.json()
8484
assert response.status_code == 200, response.text
8585
assert data["name"] == hero2_data["name"], "The name should not be set to none"
86-
assert (
87-
data["secret_name"] == "Spider-Youngster"
88-
), "The secret name should be updated"
86+
assert data["secret_name"] == "Spider-Youngster", (
87+
"The secret name should be updated"
88+
)
8989
assert "password" not in data
9090
assert "hashed_password" not in data
9191
with Session(mod.engine) as session:
@@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel):
9898
data = response.json()
9999
assert response.status_code == 200, response.text
100100
assert data["name"] == hero3_data["name"]
101-
assert (
102-
data["age"] is None
103-
), "A field should be updatable to None, even if that's the default"
101+
assert data["age"] is None, (
102+
"A field should be updatable to None, even if that's the default"
103+
)
104104
assert "password" not in data
105105
assert "hashed_password" not in data
106106
with Session(mod.engine) as session:

tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel):
8383
data = response.json()
8484
assert response.status_code == 200, response.text
8585
assert data["name"] == hero2_data["name"], "The name should not be set to none"
86-
assert (
87-
data["secret_name"] == "Spider-Youngster"
88-
), "The secret name should be updated"
86+
assert data["secret_name"] == "Spider-Youngster", (
87+
"The secret name should be updated"
88+
)
8989
assert "password" not in data
9090
assert "hashed_password" not in data
9191
with Session(mod.engine) as session:
@@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel):
9898
data = response.json()
9999
assert response.status_code == 200, response.text
100100
assert data["name"] == hero3_data["name"]
101-
assert (
102-
data["age"] is None
103-
), "A field should be updatable to None, even if that's the default"
101+
assert data["age"] is None, (
102+
"A field should be updatable to None, even if that's the default"
103+
)
104104
assert "password" not in data
105105
assert "hashed_password" not in data
106106
with Session(mod.engine) as session:

0 commit comments

Comments
 (0)