Skip to content

Commit 8cf4462

Browse files
committed
single quotes
1 parent 063b71d commit 8cf4462

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pydantic_settings/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

tests/test_multi_source.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
)
1616

1717
def 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

0 commit comments

Comments
 (0)