That Test Framework

A few weeks ago I dreamt about a unit testing framework for Python.  Well, I’ve put together a proof-of-concept prototype.  What you can do with it:

  • Set up tests and nested test suites
  • Provide per-suite or per-test setup and teardown on test suites
  • Provide explicit ordering to tests in particular test suites
  • Write parameterised tests

What you can’t yet do:

  • Put multiple tests in a test suite and say “if this one fails, don’t run the others”

You can download my prototype here (licensed under GPLv2).  To play with the examples:

  • run “python -i”
  • run the example tests by calling the tests suites, e.g. testSuiteA()
  • this will return a tuple of the form (passes, failures, skipped)
This entry was posted in short and tagged , , , . Bookmark the permalink.

Comments are closed.