Skip to content

Commit

Permalink
fix: response not str bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wuranxu committed Feb 6, 2024
1 parent dc857d7 commit e9cb888
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/core/executor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import json
import re
import time
from collections import defaultdict
from datetime import datetime
Expand Down Expand Up @@ -293,6 +292,9 @@ async def run_with_test_data(env, data, report_id, case_id, params_pool: dict =
request_method = result.get("request_method")
request_headers = result.get("request_headers")
response = result.get("response")
if not isinstance(response, str):
# dumps ensure response is str
response = json.dumps(response, ensure_ascii=False)
case_name = result.get("case_name")
response_headers = result.get("response_headers")
cookies = result.get("cookies")
Expand Down

0 comments on commit e9cb888

Please sign in to comment.