Skip to content

Commit fc15ba0

Browse files
author
Pyry Kovanen
committed
Parametrize JSON roundtrip test with xfail mark
1 parent 03a2b8a commit fc15ba0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pandas/tests/io/json/test_json_table_schema.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,15 @@ def test_multiindex(self, index_names):
561561
result = pd.read_json(out, orient="table")
562562
tm.assert_frame_equal(df, result)
563563

564-
def test_empty_frame_roundtrip(self):
564+
@pytest.mark.parametrize("strict_check", [
565+
pytest.param(True, marks=pytest.mark.xfail), False])
566+
def test_empty_frame_roundtrip(self, strict_check):
565567
# GH 21287
566568
df = pd.DataFrame([], columns=['a', 'b', 'c'])
567569
expected = df.copy()
568570
out = df.to_json(orient='table')
569571
result = pd.read_json(out, orient='table')
570-
# TODO: After DF coercion issue (GH 21345) is resolved, tighten type checks
572+
# TODO: When DF coercion issue (#21345) is resolved tighten type checks
571573
tm.assert_frame_equal(expected, result,
572-
check_dtype=False, check_index_type=False)
574+
check_dtype=strict_check,
575+
check_index_type=strict_check)

0 commit comments

Comments
 (0)