Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backend/app/tests/api/routes/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ def test_use_access_token(
def test_recovery_password(
client: TestClient, normal_user_token_headers: dict[str, str]
) -> None:
with patch("app.core.config.settings.SMTP_HOST", "smtp.example.com"), patch(
"app.core.config.settings.SMTP_USER", "[email protected]"
with (
patch("app.core.config.settings.SMTP_HOST", "smtp.example.com"),
patch("app.core.config.settings.SMTP_USER", "[email protected]"),
):
email = "[email protected]"
r = client.post(
Expand Down
8 changes: 5 additions & 3 deletions backend/app/tests/api/routes/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ def test_get_users_normal_user_me(
def test_create_user_new_email(
client: TestClient, superuser_token_headers: dict[str, str], db: Session
) -> None:
with patch("app.utils.send_email", return_value=None), patch(
"app.core.config.settings.SMTP_HOST", "smtp.example.com"
), patch("app.core.config.settings.SMTP_USER", "[email protected]"):
with (
patch("app.utils.send_email", return_value=None),
patch("app.core.config.settings.SMTP_HOST", "smtp.example.com"),
patch("app.core.config.settings.SMTP_USER", "[email protected]"),
):
username = random_email()
password = random_lower_string()
data = {"email": username, "password": password}
Expand Down
9 changes: 6 additions & 3 deletions backend/app/tests/scripts/test_backend_pre_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ def test_init_successful_connection() -> None:
exec_mock = MagicMock(return_value=True)
session_mock.configure_mock(**{"exec.return_value": exec_mock})

with patch("sqlmodel.Session", return_value=session_mock), patch.object(
logger, "info"
), patch.object(logger, "error"), patch.object(logger, "warn"):
with (
patch("sqlmodel.Session", return_value=session_mock),
patch.object(logger, "info"),
patch.object(logger, "error"),
patch.object(logger, "warn"),
):
try:
init(engine_mock)
connection_successful = True
Expand Down
9 changes: 6 additions & 3 deletions backend/app/tests/scripts/test_test_pre_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ def test_init_successful_connection() -> None:
exec_mock = MagicMock(return_value=True)
session_mock.configure_mock(**{"exec.return_value": exec_mock})

with patch("sqlmodel.Session", return_value=session_mock), patch.object(
logger, "info"
), patch.object(logger, "error"), patch.object(logger, "warn"):
with (
patch("sqlmodel.Session", return_value=session_mock),
patch.object(logger, "info"),
patch.object(logger, "error"),
patch.object(logger, "warn"),
):
try:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes are due to running sh scripts/format.sh :)

init(engine_mock)
connection_successful = True
Expand Down
5 changes: 0 additions & 5 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ types-python-jose = "^3.3.4.20240106"
types-passlib = "^1.7.7.20240106"
coverage = "^7.4.3"

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
line_length = 88
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Expand Down
6 changes: 0 additions & 6 deletions backend/scripts/format-imports.sh

This file was deleted.

5 changes: 2 additions & 3 deletions backend/scripts/format.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh -e
set -x

autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place app --exclude=__init__.py
black app
isort --recursive --apply app
ruff check app scripts --fix
ruff format app scripts
2 changes: 1 addition & 1 deletion backend/scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set -e
set -x

mypy app
ruff app
ruff check app
ruff format app --check