~/talk

Given this, assert that: fluent testing using fixtures and properties

Talkat PyCascades 2019 · 2019-02-23..02-24· [testing, python]
slides:none on file

Converts Django API tests into composable pytest fixtures so setup moves out of tests into reusable units (client, user, widget) and fixtures can include teardown and mocks; adding a Hypothesis given decorator plus a widget strategy turns one example into ~100 generated examples that check properties like preserved length and item inclusion; replacing Django test runner with pytest takes about 30 minutes in practice; result is smaller, more focused tests even if overall test count and lines sometimes increase.

AI-written summary · about

  1. 0:00Start
  2. 1:07Reducing boilerplate using pytest fixtures
  3. 3:00Real world example Testing API methods
  4. 4:48AAA Pattern: Arrange, act, assert
  5. 5:30Converting to pytest
  6. 7:27Lessons from converting an entire codebase
  7. 10:36Property-based testing
  8. 12:32A real world example
  9. 17:55propositional calculus
~/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.