File tree Expand file tree Collapse file tree 2 files changed +0
-20
lines changed Expand file tree Collapse file tree 2 files changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,6 @@ def __init__(
193193            )
194194        )
195195
196-     __init__ .__pydantic_base_init__  =  True   # type: ignore 
197- 
198196    @classmethod  
199197    def  settings_customise_sources (
200198        cls ,
Original file line number Diff line number Diff line change 2222    SecretStr ,
2323    Tag ,
2424    ValidationError ,
25-     ValidationInfo ,
26-     field_validator ,
2725)
2826from  pydantic  import  (
2927    dataclasses  as  pydantic_dataclasses ,
@@ -2774,22 +2772,6 @@ class Settings(BaseSettings):
27742772    assert  s .model_dump () ==  {'nested' : {'foo' : ['one' , 'two' ]}}
27752773
27762774
2777- def  test_validation_context ():
2778-     class  Settings (BaseSettings ):
2779-         foo : str 
2780- 
2781-         @field_validator ('foo' ) 
2782-         @classmethod  
2783-         def  test_validator (cls , v : str , info : ValidationInfo ):
2784-             context  =  info .context 
2785-             assert  context  ==  {'foo' : 'bar' }
2786-             return  v 
2787- 
2788-     s  =  Settings .model_validate ({'foo' : 'foo bar' }, context = {'foo' : 'bar' })
2789-     assert  s .foo  ==  'foo bar' 
2790-     assert  s .model_dump () ==  {'foo' : 'foo bar' }
2791- 
2792- 
27932775def  test_nested_model_field_with_alias_choices (env ):
27942776    class  NestedSettings (BaseModel ):
27952777        foo : List [str ] =  Field (alias = AliasChoices ('fooalias' , 'foo-alias' ))
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments