@@ -55,8 +55,10 @@ class _FakePostgresSettings(BaseCustomSettings):
5555 POSTGRES_PASSWORD : str
5656
5757 POSTGRES_DB : str
58- POSTGRES_MINSIZE : Annotated [int , Field (ge = 2 )] = 2
59- POSTGRES_MAXSIZE : Annotated [int , Field (ge = 2 )] = 50
58+ POSTGRES_MINSIZE : Annotated [int , Field (ge = 1 )] = 1
59+ POSTGRES_MAXSIZE : Annotated [int , Field (ge = 1 )] = 50
60+ POSTGRES_MAX_POOLSIZE : int = 10
61+ POSTGRES_MAX_OVERFLOW : Annotated [int , Field (ge = 0 )] = 20
6062
6163 POSTGRES_CLIENT_NAME : Annotated [
6264 str | None ,
@@ -126,7 +128,6 @@ class S5(BaseCustomSettings):
126128def test_parse_from_empty_envs (
127129 postgres_envvars_unset : None , model_classes_factory : Callable
128130):
129-
130131 S1 , S2 , S3 , S4 , S5 = model_classes_factory ()
131132
132133 with pytest .raises (ValidationError , match = "WEBSERVER_POSTGRES" ) as exc_info :
@@ -160,7 +161,6 @@ def test_parse_from_individual_envs(
160161 monkeypatch : pytest .MonkeyPatch ,
161162 model_classes_factory : Callable ,
162163):
163-
164164 S1 , S2 , S3 , S4 , S5 = model_classes_factory ()
165165
166166 # environment
@@ -200,7 +200,9 @@ def test_parse_from_individual_envs(
200200 "POSTGRES_PASSWORD" : "shh" ,
201201 "POSTGRES_DB" : "db" ,
202202 "POSTGRES_MAXSIZE" : 50 ,
203- "POSTGRES_MINSIZE" : 2 ,
203+ "POSTGRES_MINSIZE" : 1 ,
204+ "POSTGRES_MAX_POOLSIZE" : 10 ,
205+ "POSTGRES_MAX_OVERFLOW" : 20 ,
204206 "POSTGRES_CLIENT_NAME" : None ,
205207 }
206208 }
@@ -215,7 +217,9 @@ def test_parse_from_individual_envs(
215217 "POSTGRES_PASSWORD" : "shh" ,
216218 "POSTGRES_DB" : "db" ,
217219 "POSTGRES_MAXSIZE" : 50 ,
218- "POSTGRES_MINSIZE" : 2 ,
220+ "POSTGRES_MINSIZE" : 1 ,
221+ "POSTGRES_MAX_POOLSIZE" : 10 ,
222+ "POSTGRES_MAX_OVERFLOW" : 20 ,
219223 "POSTGRES_CLIENT_NAME" : None ,
220224 }
221225 }
@@ -228,7 +232,6 @@ def test_parse_from_individual_envs(
228232def test_parse_compact_env (
229233 postgres_envvars_unset : None , monkeypatch , model_classes_factory
230234):
231-
232235 S1 , S2 , S3 , S4 , S5 = model_classes_factory ()
233236
234237 # environment
@@ -262,7 +265,9 @@ def test_parse_compact_env(
262265 "POSTGRES_PASSWORD" : "shh2" ,
263266 "POSTGRES_DB" : "db2" ,
264267 "POSTGRES_MAXSIZE" : 50 ,
265- "POSTGRES_MINSIZE" : 2 ,
268+ "POSTGRES_MINSIZE" : 1 ,
269+ "POSTGRES_MAX_POOLSIZE" : 10 ,
270+ "POSTGRES_MAX_OVERFLOW" : 20 ,
266271 "POSTGRES_CLIENT_NAME" : None ,
267272 }
268273 }
@@ -342,7 +347,6 @@ def test_parse_compact_env(
342347def test_parse_from_mixed_envs (
343348 postgres_envvars_unset : None , monkeypatch , model_classes_factory
344349):
345-
346350 S1 , S2 , S3 , S4 , S5 = model_classes_factory ()
347351
348352 # environment
@@ -372,7 +376,9 @@ def test_parse_from_mixed_envs(
372376 "POSTGRES_PASSWORD" : "shh2" ,
373377 "POSTGRES_DB" : "db2" ,
374378 "POSTGRES_MAXSIZE" : 50 ,
375- "POSTGRES_MINSIZE" : 2 ,
379+ "POSTGRES_MINSIZE" : 1 ,
380+ "POSTGRES_MAX_POOLSIZE" : 10 ,
381+ "POSTGRES_MAX_OVERFLOW" : 20 ,
376382 "POSTGRES_CLIENT_NAME" : None ,
377383 }
378384 }
@@ -472,7 +478,6 @@ def test_parse_from_mixed_envs(
472478def test_toggle_plugin_1 (
473479 postgres_envvars_unset : None , monkeypatch , model_classes_factory
474480):
475-
476481 * _ , S4 , S5 = model_classes_factory ()
477482
478483 # empty environ
@@ -535,7 +540,6 @@ def test_toggle_plugin_3(
535540def test_toggle_plugin_4 (
536541 postgres_envvars_unset : None , monkeypatch , model_classes_factory
537542):
538-
539543 * _ , S4 , S5 = model_classes_factory ()
540544 JSON_VALUE = '{"POSTGRES_HOST":"pg2", "POSTGRES_USER":"test2", "POSTGRES_PASSWORD":"shh2", "POSTGRES_DB":"db2"}'
541545
@@ -565,7 +569,6 @@ def test_toggle_plugin_4(
565569 )
566570
567571 with monkeypatch .context () as patch :
568-
569572 # Enables both but remove individuals
570573 setenvs_from_envfile (
571574 patch ,
0 commit comments