File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ classifiers = [
40
40
]
41
41
requires-python = ' >=3.7'
42
42
dependencies = [
43
- ' pydantic>=2.0' ,
43
+ ' pydantic>=2.0.1 ' ,
44
44
' python-dotenv>=0.21.0' ,
45
45
]
46
46
dynamic = [' version' ]
Original file line number Diff line number Diff line change 6
6
#
7
7
annotated-types==0.4.0
8
8
# via pydantic
9
- pydantic==2.0
9
+ pydantic==2.0.1
10
10
# via pydantic-settings (pyproject.toml)
11
- pydantic-core==2.0.1
11
+ pydantic-core==2.0.2
12
12
# via pydantic
13
13
python-dotenv==0.21.1
14
14
# via pydantic-settings (pyproject.toml)
Original file line number Diff line number Diff line change @@ -1620,19 +1620,31 @@ class Settings(BaseSettings):
1620
1620
1621
1621
def test_protected_namespace_defaults ():
1622
1622
# pydantic default
1623
- with pytest .raises ( NameError , match = 'Field "model_prefixed_field" has conflict with protected namespace "model_"' ):
1623
+ with pytest .warns ( UserWarning , match = 'Field "model_prefixed_field" has conflict with protected namespace "model_"' ):
1624
1624
1625
1625
class Model (BaseSettings ):
1626
1626
model_prefixed_field : str
1627
1627
1628
1628
# pydantic-settings default
1629
1629
with pytest .raises (
1630
- NameError , match = 'Field "settings_prefixed_field" has conflict with protected namespace "settings_"'
1630
+ UserWarning , match = 'Field "settings_prefixed_field" has conflict with protected namespace "settings_"'
1631
1631
):
1632
1632
1633
1633
class Model1 (BaseSettings ):
1634
1634
settings_prefixed_field : str
1635
1635
1636
+ with pytest .raises (
1637
+ NameError ,
1638
+ match = (
1639
+ 'Field "settings_customise_sources" conflicts with member <bound method '
1640
+ "BaseSettings.settings_customise_sources of <class 'pydantic_settings.main.BaseSettings'>> "
1641
+ 'of protected namespace "settings_".'
1642
+ ),
1643
+ ):
1644
+
1645
+ class Model2 (BaseSettings ):
1646
+ settings_customise_sources : str
1647
+
1636
1648
1637
1649
def test_case_sensitive_from_args (monkeypatch ):
1638
1650
class Settings (BaseSettings ):
You can’t perform that action at this time.
0 commit comments