~/talk

Multiply your Testing Effectiveness with Parameterized Testing

Talkat PyCon US 2020 · 2020-04-15..04-23· [testing]
slides:none on file

Covers how pytest parametrization turns four triangle test cases into dozens with one function and demonstrates three concrete techniques: function parameterization, fixture parameterization, and the pytest_generate_tests hook. Uses a small triangle_type example with a deliberate bug, shows generators and CSV-driven cases (collected at collection time), adds readable IDs and markers, and explains running failures and subsets with flags like --lf and -k. Examples and code live on the linked GitHub.

AI-written summary · about

  1. 0:00Intro
  2. 0:30Brian Okken
  3. 1:19Value of Tests
  4. 2:18Parametrize vs Parameterize
  5. 2:46Something to Test
  6. 4:11without Parametrization
  7. 5:02Moving to one test (don't do this)
  8. 5:47Function Parametrization
  9. 6:43Parameters from a named list
  10. 7:16Parameters from a function
  11. 7:55Parameters from a generator
  12. 8:13Parameters from a file
  13. 9:24Run the last failing test case
  14. 10:20Run test cases with 60 degree angles
  15. 10:34Run an individual test case
  16. 10:51Fixture Parametrization
  17. 11:59Object parameters get non-helpful names
  18. 12:35An ids function
  19. 13:22Custom ids function
  20. 14:03pytest_generate_tests()
  21. 14:41metafunc
  22. 15:35test.param
  23. 16:53indirect parameter
  24. 17:58indirect example
  25. 18:38More test cases
  26. 19:22Review
  27. 19:37Combining Techniques
  28. 20:20Resources
~/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.