File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -425,11 +425,11 @@ def _settings_build_values(
425425 except ValidationError as e :
426426 line_errors = json .loads (e .json ())
427427 for line in line_errors :
428- if line .get ("type" , "" ) == " missing" :
428+ if line .get ("type" , "" ) == ' missing' :
429429 continue
430430 line ['loc' ] = [source_name ] + line ['loc' ]
431- ctx = line .get (" ctx" , {})
432- ctx [" source" ] = source_name
431+ ctx = line .get (' ctx' , {})
432+ ctx [' source' ] = source_name
433433 line ['ctx' ] = ctx
434434 all_line_errors .append (line )
435435
@@ -439,7 +439,7 @@ def _settings_build_values(
439439 except ValidationError as e :
440440 line_errors = json .loads (e .json ())
441441 for line in line_errors :
442- if line .get (" type" , "" ) != " missing" :
442+ if line .get (' type' , '' ) != ' missing' :
443443 continue
444444 all_line_errors .append (line )
445445
Original file line number Diff line number Diff line change 1515)
1616
1717def test_line_errors_from_source (monkeypatch , tmp_path ):
18- monkeypatch .setenv (" SETTINGS_NESTED__NESTED_FIELD" , "a" )
18+ monkeypatch .setenv (' SETTINGS_NESTED__NESTED_FIELD' , 'a' )
1919 p = tmp_path / 'settings.json'
2020 p .write_text (
2121 """
@@ -29,8 +29,8 @@ class Nested(BaseModel):
2929 class Settings (BaseSettings ):
3030 model_config = SettingsConfigDict (
3131 json_file = p ,
32- env_prefix = " SETTINGS_" ,
33- env_nested_delimiter = "__" ,
32+ env_prefix = ' SETTINGS_' ,
33+ env_nested_delimiter = '__' ,
3434 validate_each_source = True
3535 )
3636 foobar : str
You can’t perform that action at this time.
0 commit comments