~/workshop

Workshop: Introduction to Testing in Python

Workshopat PyCon APAC 2019 · on Sunday, 2019-02-24· [python, testing]
slides:none on file

Workshop builds a credit card validator, fixes real bugs and adds unit tests that actually assert behavior rather than restating the topic, using pytest for discovery and parameterization, unittest.mock and requests‑mock to avoid network flakiness, and coverage.py to report which lines never run. The code is refactored to separate input/output from logic so tests are deterministic, tests catch issuer and length errors, and mocked API responses let API‑dependent checks run reliably.

AI-written summary · about

  1. 0:00Start
  2. 0:09Welcome to Introduction to Testing in Python
  3. 6:07Naive Testing
  4. 6:49Test Functions
  5. 7:09Test Runner
  6. 7:47Step Five We Will See How To Write Test Case Classes
  7. 8:09Parametrizing Your Tests
  8. 9:56To Refactor Your Code for Testing
  9. 11:42Clone the Repo
  10. 12:38Table of Contents
  11. 12:58Business Logic
  12. 15:07Mirror Mode
  13. 25:28Extract a Method
  14. 27:12Refactor Rename
  15. 29:58Install a Prerequisite
  16. 30:28Install Pi Test
  17. 39:06Changing the Directory Recursion
  18. 39:16Naming Conventions
  19. 42:30Commit
  20. 45:47Step 4
  21. 1:05:58Length Check
  22. 1:24:50Step 6
  23. 1:28:39Test Identification
  24. 1:32:23Step 7
  25. 1:36:00What Is a Mock
  26. 1:42:22Backstory of this Api
  27. 1:49:11Api in Action
  28. 1:55:57Requests Mock
  29. 2:01:38Refactoring Your Code
  30. 2:15:14Step 9
  31. 2:19:31Things To Remember
~/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.