- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.6.5
+ rev: v0.9.6
hooks:
- id: ruff
args:
pytest >=7.0.1,<8.0.0
coverage[toml] >=6.2,<8.0
mypy ==1.4.1
-ruff ==0.6.2
+ruff ==0.9.6
# For FastAPI tests
fastapi >=0.103.2
httpx ==0.24.1
)
if primary_key is not Undefined:
raise RuntimeError(
- "Passing primary_key is not supported when "
- "also passing a sa_column"
+ "Passing primary_key is not supported when also passing a sa_column"
)
if nullable is not Undefined:
raise RuntimeError(
)
if foreign_key is not Undefined:
raise RuntimeError(
- "Passing foreign_key is not supported when "
- "also passing a sa_column"
+ "Passing foreign_key is not supported when also passing a sa_column"
)
if ondelete is not Undefined:
raise RuntimeError(
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero2_data["name"], "The name should not be set to none"
- assert (
- data["secret_name"] == "Spider-Youngster"
- ), "The secret name should be updated"
+ assert data["secret_name"] == "Spider-Youngster", (
+ "The secret name should be updated"
+ )
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero3_data["name"]
assert data["age"] is None, (
- "A field should be updatable to None, even if " "that's the default"
+ "A field should be updatable to None, even if that's the default"
)
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero2_data["name"], "The name should not be set to none"
- assert (
- data["secret_name"] == "Spider-Youngster"
- ), "The secret name should be updated"
+ assert data["secret_name"] == "Spider-Youngster", (
+ "The secret name should be updated"
+ )
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero3_data["name"]
assert data["age"] is None, (
- "A field should be updatable to None, even if " "that's the default"
+ "A field should be updatable to None, even if that's the default"
)
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero2_data["name"], "The name should not be set to none"
- assert (
- data["secret_name"] == "Spider-Youngster"
- ), "The secret name should be updated"
+ assert data["secret_name"] == "Spider-Youngster", (
+ "The secret name should be updated"
+ )
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero3_data["name"]
assert data["age"] is None, (
- "A field should be updatable to None, even if " "that's the default"
+ "A field should be updatable to None, even if that's the default"
)
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero2_data["name"], "The name should not be set to none"
- assert (
- data["secret_name"] == "Spider-Youngster"
- ), "The secret name should be updated"
+ assert data["secret_name"] == "Spider-Youngster", (
+ "The secret name should be updated"
+ )
assert "password" not in data
assert "hashed_password" not in data
with Session(mod.engine) as session:
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero3_data["name"]
- assert (
- data["age"] is None
- ), "A field should be updatable to None, even if that's the default"
+ assert data["age"] is None, (
+ "A field should be updatable to None, even if that's the default"
+ )
assert "password" not in data
assert "hashed_password" not in data
with Session(mod.engine) as session:
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero2_data["name"], "The name should not be set to none"
- assert (
- data["secret_name"] == "Spider-Youngster"
- ), "The secret name should be updated"
+ assert data["secret_name"] == "Spider-Youngster", (
+ "The secret name should be updated"
+ )
assert "password" not in data
assert "hashed_password" not in data
with Session(mod.engine) as session:
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero3_data["name"]
- assert (
- data["age"] is None
- ), "A field should be updatable to None, even if that's the default"
+ assert data["age"] is None, (
+ "A field should be updatable to None, even if that's the default"
+ )
assert "password" not in data
assert "hashed_password" not in data
with Session(mod.engine) as session:
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero2_data["name"], "The name should not be set to none"
- assert (
- data["secret_name"] == "Spider-Youngster"
- ), "The secret name should be updated"
+ assert data["secret_name"] == "Spider-Youngster", (
+ "The secret name should be updated"
+ )
assert "password" not in data
assert "hashed_password" not in data
with Session(mod.engine) as session:
data = response.json()
assert response.status_code == 200, response.text
assert data["name"] == hero3_data["name"]
- assert (
- data["age"] is None
- ), "A field should be updatable to None, even if that's the default"
+ assert data["age"] is None, (
+ "A field should be updatable to None, even if that's the default"
+ )
assert "password" not in data
assert "hashed_password" not in data
with Session(mod.engine) as session: