Skip to content

Instantly share code, notes, and snippets.

@dduan
Created June 28, 2012 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dduan/3014542 to your computer and use it in GitHub Desktop.
Save dduan/3014542 to your computer and use it in GitHub Desktop.
Discover and run all tests in a Python project.
#!/usr/bin/python
''' Runs tests defined in package 'tests' '''
from unittest import defaultTestLoader, TextTestRunner
TextTestRunner().run(defaultTestLoader.discover('tests', pattern='*.py'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment