Skip to content

Commit 9b9acf8

Browse files
committed
Update unit tests to accommodate the change in URL type implementation from Annotated to subclass in Pydantic 2.10
https://pydantic.dev/articles/pydantic-v2-10-release#migrate-to-subclassing-instead-of-annotated-approach-for-pydantic-url-types
1 parent 04f17ac commit 9b9acf8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ print(Settings().model_dump())
7272
{
7373
'auth_key': 'xxx',
7474
'api_key': 'xxx',
75-
'redis_dsn': Url('redis://user:pass@localhost:6379/1'),
76-
'pg_dsn': MultiHostUrl('postgres://user:pass@localhost:5432/foobar'),
77-
'amqp_dsn': Url('amqp://user:pass@localhost:5672/'),
75+
'redis_dsn': RedisDsn('redis://user:pass@localhost:6379/1'),
76+
'pg_dsn': PostgresDsn('postgres://user:pass@localhost:5432/foobar'),
77+
'amqp_dsn': AmqpDsn('amqp://user:pass@localhost:5672/'),
7878
'special_function': math.cos,
7979
'domains': set(),
8080
'more_settings': {'foo': 'bar', 'apple': 1},
@@ -2075,7 +2075,7 @@ class Settings(BaseSettings):
20752075

20762076

20772077
print(Settings(database_dsn='postgres://postgres@localhost:5432/kwargs_db'))
2078-
#> database_dsn=MultiHostUrl('postgres://postgres@localhost:5432/kwargs_db')
2078+
#> database_dsn=PostgresDsn('postgres://postgres@localhost:5432/kwargs_db')
20792079
```
20802080

20812081
By flipping `env_settings` and `init_settings`, environment variables now have precedence over `__init__` kwargs.

0 commit comments

Comments
 (0)