From 3b6ab2822dd5fd24a751e7ec75987c02d29d8baa Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:41:26 +0200 Subject: [PATCH] fix tests --- packages/settings-library/requirements/_base.txt | 8 ++++++++ .../settings-library/tests/test__pydantic_settings.py | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/settings-library/requirements/_base.txt b/packages/settings-library/requirements/_base.txt index 64117c65d55..3d57d1af6c2 100644 --- a/packages/settings-library/requirements/_base.txt +++ b/packages/settings-library/requirements/_base.txt @@ -6,15 +6,23 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py +orjson==3.10.10 + # via + # -c requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/common-library/requirements/_base.in pydantic==2.9.2 # via # -c requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/common-library/requirements/_base.in # -r requirements/_base.in + # pydantic-extra-types # pydantic-settings pydantic-core==2.23.4 # via pydantic +pydantic-extra-types==2.9.0 + # via -r requirements/../../../packages/common-library/requirements/_base.in pydantic-settings==2.5.2 # via -r requirements/_base.in pygments==2.18.0 diff --git a/packages/settings-library/tests/test__pydantic_settings.py b/packages/settings-library/tests/test__pydantic_settings.py index 2d52c1096e7..976395b1b10 100644 --- a/packages/settings-library/tests/test__pydantic_settings.py +++ b/packages/settings-library/tests/test__pydantic_settings.py @@ -132,8 +132,9 @@ def test_construct(monkeypatch): # from __init__ settings_from_init = Settings( VALUE=1, - VALUE_ALSO_REQUIRED=10, VALUE_NULLABLE_REQUIRED=None, + VALUE_NULLABLE_REQUIRED_AS_WELL=None, + VALUE_REQUIRED_AS_WELL=32, ) print(settings_from_init.model_dump_json(exclude_unset=True, indent=1)) @@ -145,6 +146,8 @@ def test_construct(monkeypatch): "VALUE": "1", "VALUE_ALSO_REQUIRED": "10", "VALUE_NULLABLE_REQUIRED": "null", + "VALUE_NULLABLE_REQUIRED_AS_WELL": "null", + "VALUE_REQUIRED_AS_WELL": "32", }, ) # WARNING: set this env to None would not work w/o ``parse_none`` validator! bug???