This project integrates inline-snapshot into pandas testing utils like assert_frame_equal
.
def test_assert_equal():
df = DataFrame({"col0": [1, 2], "col1": [1, 5j], "col3": ["a", "b"]})
# the second argument can be a snapshot
assert_frame_equal(
df,
snapshot(
DataFrame(
[
{"col0": 1, "col1": (1 0j), "col3": "a"},
{"col0": 2, "col1": 5j, "col3": "b"},
]
)
),
)