@@ -75,12 +75,15 @@ def test_httpserver(monkeypatch, debug, gunicorn_missing, expected):
7575
7676 wrapper .run (host , port )
7777
78- assert wrapper .server_class .calls == [pretend .call (app , host , port , ** options )]
78+ assert wrapper .server_class .calls == [
79+ pretend .call (app , host , port , debug , ** options )
80+ ]
7981 assert http_server .run .calls == [pretend .call ()]
8082
8183
8284@pytest .mark .skipif ("platform.system() == 'Windows'" )
83- def test_gunicorn_application ():
85+ @pytest .mark .parametrize ("debug" , [True , False ])
86+ def test_gunicorn_application (debug ):
8487 app = pretend .stub ()
8588 host = "1.2.3.4"
8689 port = "1234"
@@ -89,7 +92,7 @@ def test_gunicorn_application():
8992 import functions_framework ._http .gunicorn
9093
9194 gunicorn_app = functions_framework ._http .gunicorn .GunicornApplication (
92- app , host , port , ** options
95+ app , host , port , debug , ** options
9396 )
9497
9598 assert gunicorn_app .app == app
@@ -107,23 +110,25 @@ def test_gunicorn_application():
107110 assert gunicorn_app .load () == app
108111
109112
110- def test_flask_application ():
113+ @pytest .mark .parametrize ("debug" , [True , False ])
114+ def test_flask_application (debug ):
111115 app = pretend .stub (run = pretend .call_recorder (lambda * a , ** kw : None ))
112116 host = pretend .stub ()
113117 port = pretend .stub ()
114118 options = {"a" : pretend .stub (), "b" : pretend .stub ()}
115119
116120 flask_app = functions_framework ._http .flask .FlaskApplication (
117- app , host , port , ** options
121+ app , host , port , debug , ** options
118122 )
119123
120124 assert flask_app .app == app
121125 assert flask_app .host == host
122126 assert flask_app .port == port
127+ assert flask_app .debug == debug
123128 assert flask_app .options == options
124129
125130 flask_app .run ()
126131
127132 assert app .run .calls == [
128- pretend .call (host , port , debug = True , a = options ["a" ], b = options ["b" ]),
133+ pretend .call (host , port , debug = debug , a = options ["a" ], b = options ["b" ]),
129134 ]
0 commit comments