2026-01-12-pytest

Note: the name of the package in this repo is pytest1, DO NOT name it only pytest it will conflight with the PyPI pytest package and cause errors.

Exercise

  1. Create a github repo, clone it down to your computer
  2. Use copier copy gh:pyopensci/pyos-package-template . to create an empty package shell (might also mean create new env)
  3. Delete all the non package files (only keep the bare minimum package files), delete the test folder too
  4. test that your package installs and runs
  5. we will do testing today

iclicker

When should you write tests?

A. before you write the function implementation B. after you write the function implementation C. during implementation writing D. when you discover a bug