Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You won't always find one to one equivalents of Ruby testing tools in Python, but there are some great testing tools in Python. Some of the tools that I've found useful include:</p> <ul> <li><a href="http://docs.python.org/library/unittest.html" rel="noreferrer">unittest</a> - the xUnit tool included in the Python standard library. It includes all the basics for unit testing. </li> <li><a href="http://docs.python.org/library/doctest.html" rel="noreferrer">doctest</a> - an awesome part of the standard library, it allows you to write tests in the docstrings of functions, classes, modules, methods. It is great at conveying intended API usage. <a href="http://blog.ianbicking.org/behavior-driven-programming.html" rel="noreferrer">Ian Bicking</a> suggests using doctest for Behavior Driven Development. Doctest fits very well into the <a href="http://sphinx.pocoo.org/" rel="noreferrer">Sphinx</a> documentation system (you can make sure all the examples in your documentation pass every time you build the docs).</li> <li><a href="http://somethingaboutorange.com/mrl/projects/nose/" rel="noreferrer">nose</a> and <a href="http://codespeak.net/py/dist/test/" rel="noreferrer">py.test</a> are seen as the next-gen versions of unittest. They can run all existing unittest cases, but allow for easier, non-class based unit tests. py.test also allows for distributed execution.</li> <li><a href="http://www.voidspace.org.uk/python/mock.html" rel="noreferrer">mock</a> is a nice library for mocking behavior.</li> <li><a href="http://github.com/brunobord/tdaemon" rel="noreferrer">tdaemon</a> watches a directory for updates to your code and will re-execute your test suite. (my <a href="http://github.com/johnpaulett/tdaemon" rel="noreferrer">personal branch</a> contains a few unmerged improvements).</li> <li><a href="http://buildbot.net/" rel="noreferrer">Buildbot</a>, <a href="http://bitten.edgewall.org/" rel="noreferrer">Bitten</a>, and even <a href="http://hudson-ci.org/" rel="noreferrer">Hudson</a> all work well as full-fledged continuous integration servers for Python code. </li> <li><a href="http://nedbatchelder.com/code/coverage/" rel="noreferrer">coverage.py</a> computes the code coverage of your code.</li> <li><a href="http://www.logilab.org/857" rel="noreferrer">pylint</a> will provide a lint-like analysis of your code, making sure it follows common coding conventions and does not have any common bugs. There is also a "lighter" analysis tool, <a href="http://divmod.org/trac/wiki/DivmodPyflakes" rel="noreferrer">PyFlakes</a>.</li> <li>There are a number of HTTP / Browser testing tools that work well in Python, including <a href="http://twill.idyll.org/python-api.html" rel="noreferrer">Twill</a>, <a href="http://seleniumhq.org/" rel="noreferrer">Selenium</a>, and <a href="http://www.getwindmill.com/" rel="noreferrer">Windmill</a>.</li> </ul> <p>If you are using Django on App Engine, it includes <a href="http://docs.djangoproject.com/en/dev/topics/testing/" rel="noreferrer">several extensions</a> to unittest that allow you simulate an HTTP client and database persistence.</p> <p>There are a ton of other tools that I have not used (such as <a href="http://www.codeplex.com/pyspec/" rel="noreferrer">PySpec</a> and <a href="http://pypi.python.org/pypi/Behaviour" rel="noreferrer">Behaviour</a>) that could also be helpful. I haven't seen any mutation testing tool in Python, but I bet there is one out there (I would love to learn what it is).</p> <p>Happy testing!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload