Skip to content

Commit 12e4018

Browse files
author
David Laban
committed
test for syntax error in debug mode
1 parent 84a2b3b commit 12e4018

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_functions.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,19 @@ def test_invalid_function_definition_function_syntax_error():
323323
)
324324

325325

326+
def test_invalid_function_definition_function_syntax_robustness_with_debug(monkeypatch):
327+
monkeypatch.setattr(
328+
functions_framework.werkzeug.serving, "is_running_from_reloader", lambda: True
329+
)
330+
source = TEST_FUNCTIONS_DIR / "background_load_error" / "main.py"
331+
target = "function"
332+
333+
client = create_app(target, source).test_client()
334+
335+
resp = client.get("/")
336+
assert resp.status_code == 500
337+
338+
326339
def test_invalid_function_definition_missing_dependency():
327340
source = TEST_FUNCTIONS_DIR / "background_missing_dependency" / "main.py"
328341
target = "function"

0 commit comments

Comments
 (0)