From 87096f4d0b8a502f33be1763386e7f30eacd86ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:51:19 +0000 Subject: [PATCH 1/5] =?UTF-8?q?=E2=AC=86=20Bump=20ruff=20from=200.6.2=20to?= =?UTF-8?q?=200.9.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.2 to 0.9.6. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.6.2...0.9.6) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 847ce90c4a..cd9c96d130 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -3,7 +3,7 @@ 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 From 68450c7c3bfe28c275718a7f86936a9f2f17b1a4 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 3 Mar 2025 14:24:32 +0100 Subject: [PATCH 2/5] format with ruff 0.9.6 --- sqlmodel/main.py | 6 ++---- .../test_fastapi/test_update/test_tutorial001.py | 8 ++++---- .../test_update/test_tutorial001_py310.py | 8 ++++---- .../test_update/test_tutorial001_py39.py | 8 ++++---- .../test_fastapi/test_update/test_tutorial002.py | 12 ++++++------ .../test_update/test_tutorial002_py310.py | 12 ++++++------ .../test_update/test_tutorial002_py39.py | 12 ++++++------ 7 files changed, 32 insertions(+), 34 deletions(-) diff --git a/sqlmodel/main.py b/sqlmodel/main.py index 3532e81a8e..8549274e22 100644 --- a/sqlmodel/main.py +++ b/sqlmodel/main.py @@ -134,8 +134,7 @@ def __init__(self, default: Any = Undefined, **kwargs: Any) -> None: ) 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( @@ -143,8 +142,7 @@ def __init__(self, default: Any = Undefined, **kwargs: Any) -> None: ) 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( diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py index 0856b24676..6f3856912e 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py @@ -49,16 +49,16 @@ def test_tutorial(clear_sqlmodel): 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"}) diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py index d79b2ecea3..119634dc1e 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py @@ -52,16 +52,16 @@ def test_tutorial(clear_sqlmodel): 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"}) diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py index 1be81dec2e..455480f735 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py @@ -52,16 +52,16 @@ def test_tutorial(clear_sqlmodel): 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"}) diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py index 32e343ed61..2a929f6dae 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py @@ -80,9 +80,9 @@ def test_tutorial(clear_sqlmodel): 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: @@ -95,9 +95,9 @@ def test_tutorial(clear_sqlmodel): 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: diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py index b05f5b2133..7617f14996 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py @@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel): 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: @@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel): 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: diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py index 807e33421a..dc788a29f7 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py @@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel): 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: @@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel): 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: From 45f5ef6bdceedeba29b57347bebda9e7b0f59c9b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 13:24:52 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20for?= =?UTF-8?q?mat=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test_fastapi/test_update/test_tutorial001.py | 12 ++++++------ .../test_update/test_tutorial001_py310.py | 12 ++++++------ .../test_update/test_tutorial001_py39.py | 12 ++++++------ .../test_fastapi/test_update/test_tutorial002.py | 12 ++++++------ .../test_update/test_tutorial002_py310.py | 12 ++++++------ .../test_update/test_tutorial002_py39.py | 12 ++++++------ 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py index 6f3856912e..6be2b9d7a6 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py @@ -49,17 +49,17 @@ def test_tutorial(clear_sqlmodel): 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" - ) + assert ( + data["age"] is None + ), "A field should be updatable to None, even if that's the default" response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"}) assert response.status_code == 404, response.text diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py index 119634dc1e..2d7a5e8785 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py @@ -52,17 +52,17 @@ def test_tutorial(clear_sqlmodel): 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" - ) + assert ( + data["age"] is None + ), "A field should be updatable to None, even if that's the default" response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"}) assert response.status_code == 404, response.text diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py index 455480f735..41eff6cd16 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py @@ -52,17 +52,17 @@ def test_tutorial(clear_sqlmodel): 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" - ) + assert ( + data["age"] is None + ), "A field should be updatable to None, even if that's the default" response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"}) assert response.status_code == 404, response.text diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py index 2a929f6dae..32e343ed61 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py @@ -80,9 +80,9 @@ def test_tutorial(clear_sqlmodel): 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: @@ -95,9 +95,9 @@ def test_tutorial(clear_sqlmodel): 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: diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py index 7617f14996..b05f5b2133 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py @@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel): 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: @@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel): 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: diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py index dc788a29f7..807e33421a 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py @@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel): 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: @@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel): 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: From e23ea528f8324743ec6f470974927ff5d57662b0 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 3 Mar 2025 14:27:38 +0100 Subject: [PATCH 4/5] also bump in pre-commit config --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b1b10a68f..c385ccfd3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - 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: From 5851197548fe965bcc13f49a60b46266a0680eb5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 13:28:18 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20for?= =?UTF-8?q?mat=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test_fastapi/test_update/test_tutorial001.py | 12 ++++++------ .../test_update/test_tutorial001_py310.py | 12 ++++++------ .../test_update/test_tutorial001_py39.py | 12 ++++++------ .../test_fastapi/test_update/test_tutorial002.py | 12 ++++++------ .../test_update/test_tutorial002_py310.py | 12 ++++++------ .../test_update/test_tutorial002_py39.py | 12 ++++++------ 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py index 6be2b9d7a6..6f3856912e 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py @@ -49,17 +49,17 @@ def test_tutorial(clear_sqlmodel): 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" + assert data["age"] is None, ( + "A field should be updatable to None, even if that's the default" + ) response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"}) assert response.status_code == 404, response.text diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py index 2d7a5e8785..119634dc1e 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py @@ -52,17 +52,17 @@ def test_tutorial(clear_sqlmodel): 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" + assert data["age"] is None, ( + "A field should be updatable to None, even if that's the default" + ) response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"}) assert response.status_code == 404, response.text diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py index 41eff6cd16..455480f735 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py @@ -52,17 +52,17 @@ def test_tutorial(clear_sqlmodel): 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" + assert data["age"] is None, ( + "A field should be updatable to None, even if that's the default" + ) response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"}) assert response.status_code == 404, response.text diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py index 32e343ed61..2a929f6dae 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py @@ -80,9 +80,9 @@ def test_tutorial(clear_sqlmodel): 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: @@ -95,9 +95,9 @@ def test_tutorial(clear_sqlmodel): 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: diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py index b05f5b2133..7617f14996 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py @@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel): 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: @@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel): 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: diff --git a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py index 807e33421a..dc788a29f7 100644 --- a/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py +++ b/tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py @@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel): 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: @@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel): 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: