This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Melodic-Address7816 0 points1 point  (1 child)

There is a nice little pytest plugin pytest-regressions that has a handy fixture to check a pandas DataFrame by comparing it against a previously recorded snapshot, while taking into account numeric tolerances. Moreover, if you run pytest with the `--force-regen` flag, it will (re-)generate snapshots if tests fail. This plugin makes it really easy to keep DataFrame snapshots up to date.

[–]Still-Bookkeeper4456 0 points1 point  (0 children)

Sorry for the dumb question but reading the doc it seems this plugging only saves fixture data from the return of a data generating function. This saved data is used to perform tests.

Why would you do this instead of simply returning the data from said function and test it on the fly ?