@@ -170,12 +170,12 @@ def test_parse_from_individual_envs(
170170 }
171171
172172 s2 = S2 ()
173- assert s2 .dict (exclude_unset = True ) == {}
174- assert s2 .dict () == {"WEBSERVER_POSTGRES_NULLABLE_OPTIONAL" : None }
173+ assert s2 .model_dump (exclude_unset = True ) == {}
174+ assert s2 .model_dump () == {"WEBSERVER_POSTGRES_NULLABLE_OPTIONAL" : None }
175175
176176 s3 = S3 ()
177- assert s3 .dict (exclude_unset = True ) == {}
178- assert s3 .dict () == {
177+ assert s3 .model_dump (exclude_unset = True ) == {}
178+ assert s3 .model_dump () == {
179179 "WEBSERVER_POSTGRES_DEFAULT_ENV" : {
180180 "POSTGRES_HOST" : "pg" ,
181181 "POSTGRES_USER" : "test" ,
@@ -189,8 +189,8 @@ def test_parse_from_individual_envs(
189189 }
190190
191191 s4 = S4 ()
192- assert s4 .dict (exclude_unset = True ) == {}
193- assert s4 .dict () == {
192+ assert s4 .model_dump (exclude_unset = True ) == {}
193+ assert s4 .model_dump () == {
194194 "WEBSERVER_POSTGRES_NULLABLE_DEFAULT_ENV" : {
195195 "POSTGRES_HOST" : "pg" ,
196196 "POSTGRES_USER" : "test" ,
@@ -204,8 +204,8 @@ def test_parse_from_individual_envs(
204204 }
205205
206206 s5 = S5 ()
207- assert s5 .dict (exclude_unset = True ) == {}
208- assert s5 .dict () == {"WEBSERVER_POSTGRES_NULLABLE_DEFAULT_NULL" : None }
207+ assert s5 .model_dump (exclude_unset = True ) == {}
208+ assert s5 .model_dump () == {"WEBSERVER_POSTGRES_NULLABLE_DEFAULT_NULL" : None }
209209
210210
211211def test_parse_compact_env (
@@ -229,15 +229,15 @@ def test_parse_compact_env(
229229 # test
230230 s1 = S1 ()
231231
232- assert s1 .dict (exclude_unset = True ) == {
232+ assert s1 .model_dump (exclude_unset = True ) == {
233233 "WEBSERVER_POSTGRES" : {
234234 "POSTGRES_HOST" : "pg2" ,
235235 "POSTGRES_USER" : "test2" ,
236236 "POSTGRES_PASSWORD" : "shh2" ,
237237 "POSTGRES_DB" : "db2" ,
238238 }
239239 }
240- assert s1 .dict () == {
240+ assert s1 .model_dump () == {
241241 "WEBSERVER_POSTGRES" : {
242242 "POSTGRES_HOST" : "pg2" ,
243243 "POSTGRES_USER" : "test2" ,
@@ -258,7 +258,7 @@ def test_parse_compact_env(
258258 """ ,
259259 )
260260 s2 = S2 ()
261- assert s2 .dict (exclude_unset = True ) == {
261+ assert s2 .model_dump (exclude_unset = True ) == {
262262 "WEBSERVER_POSTGRES_NULLABLE_OPTIONAL" : {
263263 "POSTGRES_HOST" : "pg2" ,
264264 "POSTGRES_USER" : "test2" ,
@@ -278,7 +278,7 @@ def test_parse_compact_env(
278278 # default until it is really needed. Here before it would
279279 # fail because default cannot be computed even if the final value can!
280280 s3 = S3 ()
281- assert s3 .dict (exclude_unset = True ) == {
281+ assert s3 .model_dump (exclude_unset = True ) == {
282282 "WEBSERVER_POSTGRES_DEFAULT_ENV" : {
283283 "POSTGRES_HOST" : "pg2" ,
284284 "POSTGRES_USER" : "test2" ,
@@ -295,7 +295,7 @@ def test_parse_compact_env(
295295 """ ,
296296 )
297297 s4 = S4 ()
298- assert s4 .dict (exclude_unset = True ) == {
298+ assert s4 .model_dump (exclude_unset = True ) == {
299299 "WEBSERVER_POSTGRES_NULLABLE_DEFAULT_ENV" : {
300300 "POSTGRES_HOST" : "pg2" ,
301301 "POSTGRES_USER" : "test2" ,
@@ -312,7 +312,7 @@ def test_parse_compact_env(
312312 """ ,
313313 )
314314 s5 = S5 ()
315- assert s5 .dict (exclude_unset = True ) == {
315+ assert s5 .model_dump (exclude_unset = True ) == {
316316 "WEBSERVER_POSTGRES_NULLABLE_DEFAULT_NULL" : {
317317 "POSTGRES_HOST" : "pg2" ,
318318 "POSTGRES_USER" : "test2" ,
@@ -348,7 +348,7 @@ def test_parse_from_mixed_envs(
348348
349349 s1 = S1 ()
350350
351- assert s1 .dict () == {
351+ assert s1 .model_dump () == {
352352 "WEBSERVER_POSTGRES" : {
353353 "POSTGRES_HOST" : "pg2" ,
354354 "POSTGRES_USER" : "test2" ,
@@ -363,7 +363,7 @@ def test_parse_from_mixed_envs(
363363 # NOTE how unset marks also applies to embedded fields
364364 # NOTE: (1) priority of json-compact over granulated
365365 # NOTE: (2) json-compact did not define this but granulated did
366- assert s1 .dict (exclude_unset = True ) == {
366+ assert s1 .model_dump (exclude_unset = True ) == {
367367 "WEBSERVER_POSTGRES" : {
368368 "POSTGRES_HOST" : "pg2" , # <- (1)
369369 "POSTGRES_USER" : "test2" , # <- (1)
@@ -380,7 +380,7 @@ def test_parse_from_mixed_envs(
380380 )
381381
382382 s2 = S2 ()
383- assert s2 .dict (exclude_unset = True ) == {
383+ assert s2 .model_dump (exclude_unset = True ) == {
384384 "WEBSERVER_POSTGRES_NULLABLE_OPTIONAL" : {
385385 "POSTGRES_HOST" : "pg2" ,
386386 "POSTGRES_USER" : "test2" ,
@@ -397,7 +397,7 @@ def test_parse_from_mixed_envs(
397397 )
398398
399399 s3 = S3 ()
400- assert s3 .dict (exclude_unset = True ) == {
400+ assert s3 .model_dump (exclude_unset = True ) == {
401401 "WEBSERVER_POSTGRES_DEFAULT_ENV" : {
402402 "POSTGRES_HOST" : "pg2" ,
403403 "POSTGRES_USER" : "test2" ,
@@ -414,7 +414,7 @@ def test_parse_from_mixed_envs(
414414 )
415415
416416 s4 = S4 ()
417- assert s4 .dict (exclude_unset = True ) == {
417+ assert s4 .model_dump (exclude_unset = True ) == {
418418 "WEBSERVER_POSTGRES_NULLABLE_DEFAULT_ENV" : {
419419 "POSTGRES_HOST" : "pg2" ,
420420 "POSTGRES_USER" : "test2" ,
@@ -431,7 +431,7 @@ def test_parse_from_mixed_envs(
431431 )
432432
433433 s5 = S5 ()
434- assert s5 .dict (exclude_unset = True ) == {
434+ assert s5 .model_dump (exclude_unset = True ) == {
435435 "WEBSERVER_POSTGRES_NULLABLE_DEFAULT_NULL" : {
436436 "POSTGRES_HOST" : "pg2" ,
437437 "POSTGRES_USER" : "test2" ,
0 commit comments