浏览代码

fix pytest by disabling default indentation for dumps

Falko Schindler 9 月之前
父节点
当前提交
05d432d43e
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      nicegui/json/builtin_wrapper.py
  2. 1 1
      nicegui/json/orjson_wrapper.py

+ 1 - 1
nicegui/json/builtin_wrapper.py

@@ -14,7 +14,7 @@ except ImportError:
 def dumps(obj: Any,
           sort_keys: bool = False,
           separators: Optional[Tuple[str, str]] = None, *,
-          indent: bool = True) -> str:
+          indent: bool = False) -> str:
     """Serializes a Python object to a JSON-encoded string.
 
     This implementation uses Python's default json module, but extends it in order to support NumPy arrays.

+ 1 - 1
nicegui/json/orjson_wrapper.py

@@ -17,7 +17,7 @@ ORJSON_OPTS = orjson.OPT_SERIALIZE_NUMPY | orjson.OPT_NON_STR_KEYS
 def dumps(obj: Any,
           sort_keys: bool = False,
           separators: Optional[Tuple[str, str]] = None, *,
-          indent: bool = True) -> str:
+          indent: bool = False) -> str:
     """Serializes a Python object to a JSON-encoded string.
 
     By default, this function supports serializing NumPy arrays, which Python's json module does not.