~/talk

How to Write a Test Case

Talkat PyOhio 2020 · 2020-07-25..07-26· [testing]
slides:none on file

Shows the concrete Arrange‑Act‑Assert pattern and applies it to two live examples: a unit test of abs() and an API test that calls DuckDuckGo Instant Answer with the requests library, parses JSON, and asserts status code 200 and that the word "Python" appears in the abstract. Demonstrates test structure comments, uses pytest for examples, and gives specific rules: one behavior per test, independence, cleanup, plain‑language steps, and prefer simplicity.

AI-written summary · about

  1. 0:00Start
  2. 1:44Act on the Target Behavior
  3. 2:31Test Frameworks
  4. 2:56The Arrange Act Assert Pattern in Python Code
  5. 4:24Pro Tips for Writing Good Tests
~/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.