From 7314c4360366f6f95a3ee57d7e366c335015db7e Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 18 Dec 2019 16:27:25 +0800 Subject: [PATCH] fix: display indented json for request json body --- docs/CHANGELOG.md | 1 + httprunner/report.py | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a6ab030a..2c4daa13 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,7 @@ **Fixed** - fix: catch UnicodeDecodeError when json loads request body +- fix: display indented json for request json body **Changed** diff --git a/httprunner/report.py b/httprunner/report.py index 7cc84704..2ae9fa1e 100644 --- a/httprunner/report.py +++ b/httprunner/report.py @@ -162,6 +162,7 @@ def __stringify_request(request_data): try: # request body is in json format value = json.loads(value) + value = dumps_json(value) except JSONDecodeError: pass value = escape(value)