~/talk

Testing Best Practices (Tutorial)

Talkat Python Web Conf 2020 · 2020-06-17..06-19· [testing]
links:none on file
slides:none on file

Hands-on Flask tutorial that refactors a small Hacker News demo into testable library functions, shows how to replace live HTTP calls with mock.patch or the responses library, and exercises CLI and web flows so the same code formats HTML for browsers and plain text for commands. Covers testing databases (schema recreation per run), emails via Flask-Mail outbox or a fake SMTP server, using Docker/docker-compose for services, pytest fixtures, and CI tricks that cut a 1‑hour run to ~10–15 minutes.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:50Why automated testing is hard
  3. 5:21Tests as expense asset or liability
  4. 13:44Making tests easy to set up
  5. 24:47Starting the interactive tutorial
  6. 32:24Test principles and CLI exceptions
  7. 43:04Web test integration and refactoring
  8. 1:00:57Reviewing CLI and library code
  9. 1:19:05Mocking external services and state management
  10. 1:27:19Email testing with mocking methods
  11. 1:36:24Database state and generators
  12. 1:39:43Final advice and conclusion
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.