@@ -77,9 +77,9 @@ def test_is_nan():
77
77
assert is_nan (single_value )
78
78
array_f8 = np .array ([0.1 , 0.2 , np .nan ], dtype = np .dtype ("f8" ))
79
79
assert not is_nan (array_f8 )
80
- array_i4 = np .array ([10 , 2 , - (2 ** 31 ), 40 ], dtype = np .dtype ("i4" ))
80
+ array_i4 = np .array ([10 , 2 , - (2 ** 31 ), 40 ], dtype = np .dtype ("i4" ))
81
81
assert not is_nan (array_i4 )
82
- array_i1 = np .array ([1 , 0 , - (2 ** 7 ), 1 ], dtype = np .dtype ("i1" ))
82
+ array_i1 = np .array ([1 , 0 , - (2 ** 7 ), 1 ], dtype = np .dtype ("i1" ))
83
83
assert not is_nan (array_i1 )
84
84
nan_array = np .array ([np .nan , np .nan , np .nan ])
85
85
assert is_nan (nan_array )
@@ -145,15 +145,15 @@ def test_compact_json_dump():
145
145
string_stream = io .StringIO ()
146
146
_compact_json_dump (data , string_stream , indent = 2 , max_level = 0 )
147
147
assert (
148
- string_stream .getvalue ()
149
- == """{"node": [{"id": 1, "x": 2}, {"id": 3, "x": 4}], "line": [{"id": 5, "x": 6}, {"id": 7, "x": {"y": 8.1, "z": 8.2}}]}"""
148
+ string_stream .getvalue ()
149
+ == """{"node": [{"id": 1, "x": 2}, {"id": 3, "x": 4}], "line": [{"id": 5, "x": 6}, {"id": 7, "x": {"y": 8.1, "z": 8.2}}]}"""
150
150
)
151
151
152
152
string_stream = io .StringIO ()
153
153
_compact_json_dump (data , string_stream , indent = 2 , max_level = 1 )
154
154
assert (
155
- string_stream .getvalue ()
156
- == """{
155
+ string_stream .getvalue ()
156
+ == """{
157
157
"node": [{"id": 1, "x": 2}, {"id": 3, "x": 4}],
158
158
"line": [{"id": 5, "x": 6}, {"id": 7, "x": {"y": 8.1, "z": 8.2}}]
159
159
}"""
@@ -162,8 +162,8 @@ def test_compact_json_dump():
162
162
string_stream = io .StringIO ()
163
163
_compact_json_dump (data , string_stream , indent = 2 , max_level = 2 )
164
164
assert (
165
- string_stream .getvalue ()
166
- == """{
165
+ string_stream .getvalue ()
166
+ == """{
167
167
"node":
168
168
[{"id": 1, "x": 2}, {"id": 3, "x": 4}],
169
169
"line":
@@ -174,8 +174,8 @@ def test_compact_json_dump():
174
174
string_stream = io .StringIO ()
175
175
_compact_json_dump (data , string_stream , indent = 2 , max_level = 3 )
176
176
assert (
177
- string_stream .getvalue ()
178
- == """{
177
+ string_stream .getvalue ()
178
+ == """{
179
179
"node":
180
180
[
181
181
{"id": 1, "x": 2},
@@ -207,8 +207,8 @@ def test_compact_json_dump_deep():
207
207
string_stream = io .StringIO ()
208
208
_compact_json_dump (data , string_stream , indent = 2 , max_level = 10 )
209
209
assert (
210
- string_stream .getvalue ()
211
- == """{
210
+ string_stream .getvalue ()
211
+ == """{
212
212
"foo": 1,
213
213
"bar":
214
214
{
@@ -232,8 +232,8 @@ def test_compact_json_dump_batch():
232
232
string_stream = io .StringIO ()
233
233
_compact_json_dump (data , string_stream , indent = 2 , max_level = 4 )
234
234
assert (
235
- string_stream .getvalue ()
236
- == """[
235
+ string_stream .getvalue ()
236
+ == """[
237
237
{
238
238
"node":
239
239
[
0 commit comments