Write Less and Test More with Data Regression Testing
summary
Shows a concrete workflow: use pytest-regressions and its fixtures — data_regression, file_regression, image_regression, num_regression — to serialize expected outputs to CSV/JSON/image files and fail when diffs exceed tolerances. Demonstrations include generating 100-point quadratic Bézier outputs, comparing rendered Flask HTML fragments, snapshotting SQLAlchemy-serialized models, and pixel-diffing Matplotlib images. The plugin creates baseline files, supports per-field absolute/relative tolerances, and offers a force-regenerate option so baseline updates and CI reproducible tests actually work.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 2:08The problem with traditional testing
- 3:38Defining data regression testing
- 6:57Introduction to pytest-regressions
- 8:04Numerical data regression
- 16:43File and HTML regression
- 21:24Basic types and API regression
- 23:43Image regression testing
- 25:23Advanced usage and tools
- 28:37Conclusion and resources
related talks
01h 29mAdv. Software Testing for Data Scientists
01h 11mTest-Driven Data Analysis
45mImproved Regression Testing in Agile
21mDon't just test, my friend, test better
27mWhat To Expect When You're Expecting: A guide to Regression Testing
20mVisual testing with Visual Regression Tracker
42mDo Your Homework! Writing tests for Data Science and Stochastic Code
42mTesting a Data Science Model
