~/talk

pytest for unittesters

Talkat PyCon US 2024 · 2024-05-15..05-23· [testing]
links:none on file
slides:none on file

Explains why pytest actually rewrites test bytecode to give rich failure messages and preserve bare asserts in -O mode, shows assert rewriting and the warning for tuple-as-assert bugs, demonstrates fixtures with yield teardown and composable fixture injection by name, walks through parametrize and stacked parameterization that generates Cartesian products, and shows plugins that do real work like xdist parallel workers and --showlocals to capture locals on failure so migrating from unittest can be incremental.

AI-written summary · about

  1. 0:00pytest for unit testers
  2. 1:07Migrating to pytest
  3. 2:51Assertion handling in pytest
  4. 6:22Bare assertions in pytest
  5. 8:47Error messages in pytest
  6. 10:11Drop-in unittest replacement
  7. 11:57Debugging in pytest
  8. 13:21Migrating from unittest
  9. 15:28pytest fixtures
  10. 17:38Parameterizing fixtures
  11. 19:24Power of parameterization
  12. 21:34pytest plugins
  13. 24:21pytest for large codebases
  14. 27:15Learning pytest
  15. 27:56Q&A
~/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.