Skip to content

Commit d8cad14

Browse files
committed
Fixed broken test
1 parent 5deef92 commit d8cad14

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

wsgi_handler_test.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -813,18 +813,16 @@ def test_command_unknown(mock_wsgi_app_file, mock_app, wsgi_handler):
813813

814814

815815
def test_app_import_error(mock_wsgi_app_file, mock_app_with_import_error, event_v1, wsgi_handler):
816-
with pytest.raises(ImportError, match="Unable to import app app.app"):
817-
response = wsgi_handler.handler(event_v1, {})
818-
pytest.exit(response)
819-
assert response == {
820-
"statusCode": 500,
821-
"body": "<!doctype html>\n<html lang=en>\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>Unable to import app: app.app</p>\n",
822-
"headers": {
823-
"Content-Type": "text/html; charset=utf-8",
824-
"Content-Length": "140"
825-
},
826-
"isBase64Encoded": False
827-
}
816+
response = wsgi_handler.handler(event_v1, {})
817+
assert response == {
818+
"statusCode": 500,
819+
"body": "<!doctype html>\n<html lang=en>\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>Unable to import app: app.app</p>\n",
820+
"headers": {
821+
"Content-Type": "text/html; charset=utf-8",
822+
"Content-Length": "140"
823+
},
824+
"isBase64Encoded": False
825+
}
828826

829827

830828
def test_handler_with_encoded_characters_in_path(

0 commit comments

Comments
 (0)