From 75228d15f0b21f9c6ac6ddf75956ae93fe3ed107 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Thu, 4 Jun 2020 15:15:46 +0800 Subject: [PATCH] fix: only strip whitespaces and tabs, \n\r are left because they maybe used in changeset --- docs/CHANGELOG.md | 1 + httprunner/parser.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 05718bb4..78b5235d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,6 +10,7 @@ - fix: missing request json - fix: override testsuite/testcase config verify +- fix: only strip whitespaces and tabs, \n\r are left because they maybe used in changeset **Changed** diff --git a/httprunner/parser.py b/httprunner/parser.py index 3fd9a7ad..c36363ee 100644 --- a/httprunner/parser.py +++ b/httprunner/parser.py @@ -362,7 +362,8 @@ def parse_data( # content in string format may contains variables and functions variables_mapping = variables_mapping or {} functions_mapping = functions_mapping or {} - raw_data = raw_data.strip() + # only strip whitespaces and tabs, \n\r is left because they maybe used in changeset + raw_data = raw_data.strip(" \t") return parse_string(raw_data, variables_mapping, functions_mapping) elif isinstance(raw_data, (list, set, tuple)):