Don't just test, my friend, test better
summary
Covers concrete pytest techniques: use parametrize to replace repeated example tests with one function and lists of inputs, use hypothesis for property‑based generation (works well with typing) instead of hand‑picking edge cases, use fixtures to share and scope reusable setup (even persisting a Dockerized test DB), and use mark.xfail / skip to keep CI green when a feature is intentionally unimplemented—practical code patterns and tradeoffs, not abstract advice.
AI-written summary · about
chapters (30)
- 0:00Introduction
- 1:16Who uses PiTest
- 1:58What makes PiTest popular
- 2:39What is UnitTest
- 4:44PiTest features
- 5:03Parameterize
- 5:18Example
- 7:41Difference between test and parameterize
- 8:05How parameterize works
- 8:33What to test
- 8:57Dont know what to test
- 9:13Who have heard of hypothesis
- 9:39Propertybased testing
- 11:04Hypothesis decorators
- 11:15Hypothesis code
- 12:25Fixture
- 12:37Advantages
- 14:42Fixture can be shared
- 14:55Define the scope
- 16:02Documentation
- 16:18Fixtures
- 16:39MarkXFail
- 17:01What you can do
- 17:40Skip a test gracefully
- 18:34Only have a good reason
- 18:49Top tips
- 19:17Euro Python
- 20:19PiTest Documentation
- 20:35Behavioral Driven Development
- 20:53Writing small tests
related talks
28mEgad! How Do We Start Writing Better Tests?
27mTesting Beyond Examples: Property Based Testing with Hypothesis
38mTesting for the Terrified: How to Write Tests, Conquer Guilt, and Level Up
30mStop Writing Tests!
27mWhy I use py.test and maybe you should too
33mUnit Testing with Pytest
17mTest! (Some OF) Your! Code!: How To Write...
48mA Reflection on Software Testing
