~/talk

Don't just test, my friend, test better

Talkat PyCon Italia 2023 · 2023-05-25..05-28· [testing]
name:Cheuk Ho
links:none on file
slides:none on file

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

  1. 0:00Introduction
  2. 1:16Who uses PiTest
  3. 1:58What makes PiTest popular
  4. 2:39What is UnitTest
  5. 4:44PiTest features
  6. 5:03Parameterize
  7. 5:18Example
  8. 7:41Difference between test and parameterize
  9. 8:05How parameterize works
  10. 8:33What to test
  11. 8:57Dont know what to test
  12. 9:13Who have heard of hypothesis
  13. 9:39Propertybased testing
  14. 11:04Hypothesis decorators
  15. 11:15Hypothesis code
  16. 12:25Fixture
  17. 12:37Advantages
  18. 14:42Fixture can be shared
  19. 14:55Define the scope
  20. 16:02Documentation
  21. 16:18Fixtures
  22. 16:39MarkXFail
  23. 17:01What you can do
  24. 17:40Skip a test gracefully
  25. 18:34Only have a good reason
  26. 18:49Top tips
  27. 19:17Euro Python
  28. 20:19PiTest Documentation
  29. 20:35Behavioral Driven Development
  30. 20:53Writing small tests
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.