Exercises

  1. The test code in ch2 has a few intentionally failing tests. Use --pdb while running these tests. Try it without the -x option and the debugger will open multiple times, once for each failure.
  2. Try fixing the code and rerunning tests with --lf --pdb to just run the failed tests and use the debugger. Trying out debugging tools in a casual environment where you can play around and not be worried about deadlines and fixes is important.
  3. We noticed lots of missing tests during our coverage exploration. One topic missing is to test tasks.update(). Write some tests of that in the func directory.
  4. Run coverage.py. What other tests are missing? If you covered api.py, do you think it would be fully tested?
  5. Add some tests to test_cli.py to check the command-line interface for tasks update using mock.
  6. Run your new tests (along with all the old ones) against at least two Python versions with tox.
  7. Try using Jenkins to graph all the different tasks_proj versions and test permutations in the chapters.