Skip to content

Commit 21d6fcb

Browse files
authored
TST: Add test_ to four tests in test_readlines.py and fix two of them (#50445)
* added test_ to names of four tests and fixed two tests * shortened comments * changed way to convert booleans to integers and deleted comments
1 parent 38b4e96 commit 21d6fcb

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,3 @@ repos:
342342
exclude: |
343343
(?x)
344344
^pandas/tests/generic/test_generic.py # GH50380
345-
|^pandas/tests/io/json/test_readlines.py # GH50378

pandas/tests/io/json/test_readlines.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def test_to_json_append_mode(mode_):
336336
df.to_json(mode=mode_, lines=False, orient="records")
337337

338338

339-
def to_json_append_output_consistent_columns():
339+
def test_to_json_append_output_consistent_columns():
340340
# GH 35849
341341
# Testing that resulting output reads in as expected.
342342
# Testing same columns, new rows
@@ -354,7 +354,7 @@ def to_json_append_output_consistent_columns():
354354
tm.assert_frame_equal(result, expected)
355355

356356

357-
def to_json_append_output_inconsistent_columns():
357+
def test_to_json_append_output_inconsistent_columns():
358358
# GH 35849
359359
# Testing that resulting output reads in as expected.
360360
# Testing one new column, one old column, new rows
@@ -378,7 +378,7 @@ def to_json_append_output_inconsistent_columns():
378378
tm.assert_frame_equal(result, expected)
379379

380380

381-
def to_json_append_output_different_columns():
381+
def test_to_json_append_output_different_columns():
382382
# GH 35849
383383
# Testing that resulting output reads in as expected.
384384
# Testing same, differing and new columns
@@ -394,7 +394,7 @@ def to_json_append_output_different_columns():
394394
"col3": [None, None, None, None, "!", "#", None, None],
395395
"col4": [None, None, None, None, None, None, True, False],
396396
}
397-
)
397+
).astype({"col4": "float"})
398398
with tm.ensure_clean("test.json") as path:
399399
# Save dataframes to the same file
400400
df1.to_json(path, mode="a", lines=True, orient="records")
@@ -407,7 +407,7 @@ def to_json_append_output_different_columns():
407407
tm.assert_frame_equal(result, expected)
408408

409409

410-
def to_json_append_output_different_columns_reordered():
410+
def test_to_json_append_output_different_columns_reordered():
411411
# GH 35849
412412
# Testing that resulting output reads in as expected.
413413
# Testing specific result column order.
@@ -424,7 +424,7 @@ def to_json_append_output_different_columns_reordered():
424424
"col3": [None, None, "!", "#", None, None, None, None],
425425
"col1": [None, None, None, None, 3, 4, 1, 2],
426426
}
427-
)
427+
).astype({"col4": "float"})
428428
with tm.ensure_clean("test.json") as path:
429429
# Save dataframes to the same file
430430
df4.to_json(path, mode="a", lines=True, orient="records")

0 commit comments

Comments
 (0)