mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-07 15:31:23 +08:00
fix: print_info value is None
TypeError: unsupported format string passed to NoneType.__format__
This commit is contained in:
@@ -385,6 +385,8 @@ def print_info(info_mapping):
|
|||||||
continue
|
continue
|
||||||
elif isinstance(value, (dict, list)):
|
elif isinstance(value, (dict, list)):
|
||||||
value = json.dumps(value)
|
value = json.dumps(value)
|
||||||
|
elif value is None:
|
||||||
|
value = "None"
|
||||||
|
|
||||||
if is_py2:
|
if is_py2:
|
||||||
if isinstance(key, unicode):
|
if isinstance(key, unicode):
|
||||||
|
|||||||
@@ -263,3 +263,15 @@ class TestUtils(ApiServerUnittest):
|
|||||||
parameters_content_list = []
|
parameters_content_list = []
|
||||||
product_list = utils.gen_cartesian_product(*parameters_content_list)
|
product_list = utils.gen_cartesian_product(*parameters_content_list)
|
||||||
self.assertEqual(product_list, [])
|
self.assertEqual(product_list, [])
|
||||||
|
|
||||||
|
def test_print_info(self):
|
||||||
|
info_mapping = {
|
||||||
|
"a": 1,
|
||||||
|
"t": (1, 2),
|
||||||
|
"b": {
|
||||||
|
"b1": 123
|
||||||
|
},
|
||||||
|
"c": None,
|
||||||
|
"d": [4, 5]
|
||||||
|
}
|
||||||
|
utils.print_info(info_mapping)
|
||||||
|
|||||||
Reference in New Issue
Block a user