~/talk

"WHAT IS THIS MESS?" - Writing tests for pre-existing code bases

Talkat PyCon 2018 · on Friday, 2018-05-11· [python, testing]

Practical steps for putting tests around messy, untested Python: pick concrete tools (pytest, pytest-django, pytest-cov, pytest-socket, factory-boy), write a failing test for current behavior then for the desired change, and prefer integration tests when endpoints mask model behavior (example: quark model, He-Man/Skeletor bug). Break external dependencies via subclassing, patching or injectable SMTP, measure progress with coverage reports, and add CI so builds fail on regressions — small, incremental, verifiable changes.

AI-written summary · about

  1. 0:00Start
  2. 1:25What Is Legacy Code?
  3. 2:23Why SHOULDN'T We?
  4. 4:43Test What You Touch
  5. 5:48Choose Thy Weapons
  6. 7:37Assignment 1
  7. 11:30MY MAGIC PROPERTY
  8. 16:09Breaking Dependencies
  9. 16:43Assignment 2
  10. 24:51Are We Making Progress
  11. 25:54Create A Legacy
~/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.