Testing and debugging code in Python

  • Event: 2016 CAR Conference
  • Speaker: Geoff Hing of APM Reports
  • Date/Time: Saturday, Mar. 12 at 2:15pm
  • Location: Gold Coin
  • Audio file: No audio file available.

This hands-on session will walk participants through tools for testing and debugging Python code for common newsroom tasks. Participants will also learn software design patterns that make their code easier to test and debug. Participants will learn by doing as they write tests for newsroom code and fix broken code with the help of the debugger. Tools covered will be [pdb](https://docs.python.org/2/library/pdb.html) and [unittest](https://docs.python.org/2/library/unittest.html).

Suggested technical experience: Participants should be comfortable with basic command line usage and should have some experience with git. They should have written a Python program that uses packages and is broken up into multiple functions, classes and modules.

Speaker Bios

  • Geoff is a data reporter with APM Reports whose reporting has focused on voting rights and policing. He is interested in emergent forms of journalism and multidisciplinary, collective practice.

Related Tipsheets

  • TESTING AND DEBUGGING CODE IN PYTHON
    This Presentation will walk participants through tools for testing and debugging Python code for common newsroom tasks. Participants will also learn software design patterns that make their code easier to test and debug. Participants will learn by doing as they write tests for newsroom code and fix broken code with the help of the debugger. https://ghing.github.io/nicar2016-python-testing-debugging-slides/#/ https://github.com/ghing/nicar2016-python-testing-debugging-exercises