@@ -75,12 +75,15 @@ def test_httpserver(monkeypatch, debug, gunicorn_missing, expected):
75
75
76
76
wrapper .run (host , port )
77
77
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
+ ]
79
81
assert http_server .run .calls == [pretend .call ()]
80
82
81
83
82
84
@pytest .mark .skipif ("platform.system() == 'Windows'" )
83
- def test_gunicorn_application ():
85
+ @pytest .mark .parametrize ("debug" , [True , False ])
86
+ def test_gunicorn_application (debug ):
84
87
app = pretend .stub ()
85
88
host = "1.2.3.4"
86
89
port = "1234"
@@ -89,7 +92,7 @@ def test_gunicorn_application():
89
92
import functions_framework ._http .gunicorn
90
93
91
94
gunicorn_app = functions_framework ._http .gunicorn .GunicornApplication (
92
- app , host , port , ** options
95
+ app , host , port , debug , ** options
93
96
)
94
97
95
98
assert gunicorn_app .app == app
@@ -107,23 +110,25 @@ def test_gunicorn_application():
107
110
assert gunicorn_app .load () == app
108
111
109
112
110
- def test_flask_application ():
113
+ @pytest .mark .parametrize ("debug" , [True , False ])
114
+ def test_flask_application (debug ):
111
115
app = pretend .stub (run = pretend .call_recorder (lambda * a , ** kw : None ))
112
116
host = pretend .stub ()
113
117
port = pretend .stub ()
114
118
options = {"a" : pretend .stub (), "b" : pretend .stub ()}
115
119
116
120
flask_app = functions_framework ._http .flask .FlaskApplication (
117
- app , host , port , ** options
121
+ app , host , port , debug , ** options
118
122
)
119
123
120
124
assert flask_app .app == app
121
125
assert flask_app .host == host
122
126
assert flask_app .port == port
127
+ assert flask_app .debug == debug
123
128
assert flask_app .options == options
124
129
125
130
flask_app .run ()
126
131
127
132
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" ]),
129
134
]
0 commit comments