diff --git a/pyproject.toml b/pyproject.toml index d146db4e..18591922 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ classifiers = [ ] requires-python = '>=3.7' dependencies = [ - 'pydantic>=2.0', + 'pydantic>=2.0.1', 'python-dotenv>=0.21.0', ] dynamic = ['version'] diff --git a/requirements/pyproject.txt b/requirements/pyproject.txt index 44fdd85f..51a6f8be 100644 --- a/requirements/pyproject.txt +++ b/requirements/pyproject.txt @@ -6,9 +6,9 @@ # annotated-types==0.4.0 # via pydantic -pydantic==2.0 +pydantic==2.0.1 # via pydantic-settings (pyproject.toml) -pydantic-core==2.0.1 +pydantic-core==2.0.2 # via pydantic python-dotenv==0.21.1 # via pydantic-settings (pyproject.toml) diff --git a/tests/test_settings.py b/tests/test_settings.py index ca34ebf8..c709f9ad 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -1619,19 +1619,31 @@ class Settings(BaseSettings): def test_protected_namespace_defaults(): # pydantic default - with pytest.raises(NameError, match='Field "model_prefixed_field" has conflict with protected namespace "model_"'): + with pytest.warns(UserWarning, match='Field "model_prefixed_field" has conflict with protected namespace "model_"'): class Model(BaseSettings): model_prefixed_field: str # pydantic-settings default with pytest.raises( - NameError, match='Field "settings_prefixed_field" has conflict with protected namespace "settings_"' + UserWarning, match='Field "settings_prefixed_field" has conflict with protected namespace "settings_"' ): class Model1(BaseSettings): settings_prefixed_field: str + with pytest.raises( + NameError, + match=( + 'Field "settings_customise_sources" conflicts with member > " + 'of protected namespace "settings_".' + ), + ): + + class Model2(BaseSettings): + settings_customise_sources: str + def test_case_sensitive_from_args(monkeypatch): class Settings(BaseSettings):