~/talk

CLI applications & TDD: Never write scripts again

Talkat Swiss Python Summit 2022 · on Thursday, 2022-09-22· [testing, developer-experience]
links:none on file
slides:none on file

Argues that throwaway scripts should become test-driven CLI apps and shows a real refactor: a messy workflow script is turned into a package with proper if __name__ == '__main__' guard, cli-test-helpers is used to run commands and simulate argv and env for functional tests, and examples use argparse, click, docopt side-by-side. Covers packaging with entry points, running the installed CLI in a venv, and driving coverage toward 100% so behavior and deployment are verifiable.

AI-written summary · about

  1. 0:00Introduction to testing
  2. 5:02Agenda and goals
  3. 6:26Problems with raw scripts
  4. 9:15Refactoring and testing
  5. 19:23CLI library options
  6. 25:55Challenges in CLI testing
  7. 29:13Testing strategy and tools
  8. 32:26Deployment and conclusion
~/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.