-
Notifications
You must be signed in to change notification settings - Fork 0
pytest
Brent Brewington edited this page Jun 28, 2024
·
4 revisions
The pytest framework makes it easy to write small, readable tests, and can scale to support complex functional testing for applications and libraries
As data scientists & data engineers, we need to build an error-free, well-tested, and reliable data pipeline that does not break in production. That's REALLY hard to do & maintain without automated testing
(these points taken from guru99.com > pytest-tutorial)
- Very easy to start with because of its simple and easy syntax.
- Can run tests in parallel.
- Can run a specific test or a subset of tests
- Automatically detect tests
- Skip tests
- Open source
- Pytest for dbt macros
- Quick & Dirty Pytest Cookbook (by Felipe Zapata)
- pytest-docker-compose: manages containers used in integration tests
- conveyordata/data-product-portal —> backend tests with pytest
- pytest-eucalyptus: BDD plugin for pytest (parses Gherkin statements into test cases)
- PyData talk: Unit Testing for Data Scientists (Hanna Torrence)
- 01:10 Outline of testing
- 02:05 Benefits of unit Testing
- 03:20 Why people do not write unit test
- 05:25 Data Science Theory workflow and practice
- 09:05 Pytest Framework with example
- 12:10 Pytest Fixtures
- 16:15 Built-in Fixtures
- 18:10 Flexibility of Fixture
- 22:15 Mocks
- 29:15 Mock returns
- 33:50 Mock asserts
- 38:00 Running over due to time constraints