Skip to content

Commit b8a3f23

Browse files
author
Andrei Neagu
committed
fixed errors
1 parent a746b80 commit b8a3f23

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

packages/common-library/tests/test_errors_classes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ class B12(B1, ValueError):
3838

3939
def test_error_codes_and_msg_template():
4040
class MyBaseError(OsparcErrorMixin, Exception):
41-
def __init__(self, **ctx: Any) -> None:
42-
super().__init__(**ctx) # Do not forget this for base exceptions!
41+
pass
4342

4443
class MyValueError(MyBaseError, ValueError):
4544
msg_template = "Wrong value {value}"

packages/common-library/tests/test_pydantic_settings_validators.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ class Settings(BaseSettings):
2424
model_config = SettingsConfigDict()
2525

2626
app_name = faker.pystr()
27-
env_vars: dict[str, str] = {"APP_NAME": app_name}
27+
env_vars: dict[str, str | bool] = {"APP_NAME": app_name}
2828

2929
# without timedelta
3030
setenvs_from_dict(monkeypatch, env_vars)
3131
settings = Settings()
3232
print(settings.model_dump())
33-
assert settings.APP_NAME == app_name
34-
assert settings.REQUEST_TIMEOUT == timedelta(seconds=40)
33+
assert app_name == settings.APP_NAME
34+
assert timedelta(seconds=40) == settings.REQUEST_TIMEOUT
3535

3636
# with timedelta in seconds
3737
env_vars["REQUEST_TIMEOUT"] = "5555"
3838
setenvs_from_dict(monkeypatch, env_vars)
3939
settings = Settings()
4040
print(settings.model_dump())
41-
assert settings.APP_NAME == app_name
42-
assert settings.REQUEST_TIMEOUT == timedelta(seconds=5555)
41+
assert app_name == settings.APP_NAME
42+
assert timedelta(seconds=5555) == settings.REQUEST_TIMEOUT

0 commit comments

Comments
 (0)