Skip to content

Releases: 15r10nk/inline-snapshot-pandas

v0.1.1 (insider only)

07 Sep 06:10
Compare
Choose a tag to compare

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"},
                ]
            )
        ),
    )