2010-11-02 07:53:53 +08:00
2012-10-12 20:52:36 +08:00
.. _features:
2010-11-02 07:53:53 +08:00
2012-10-28 18:25:53 +08:00
pytest: helps you write better programs
2011-07-07 04:05:48 +08:00
=============================================
2010-11-06 06:37:31 +08:00
2013-02-14 21:15:13 +08:00
.. note:: Upcoming: `professional testing with pytest and tox <http://www.python-academy.com/courses/specialtopics/python_course_testing.html>`_ , 24th-26th June 2013, Leipzig.
2013-02-03 03:15:01 +08:00
2012-10-09 20:35:17 +08:00
**a mature full-featured Python testing tool**
2008-08-16 23:26:59 +08:00
2012-10-07 19:06:17 +08:00
- runs on Posix/Windows, Python 2.4-3.3, PyPy and Jython-2.5.1
2011-07-09 19:23:58 +08:00
- :ref:`comprehensive online <toc>` and `PDF documentation <pytest.pdf>`_
2011-07-07 04:05:48 +08:00
- used in :ref:`many projects and organisations <projects>`, in test
suites ranging from 10 to 10s of thousands of tests
2011-07-08 18:42:26 +08:00
- comes with many :ref:`tested examples <examples>`
2008-08-16 23:26:59 +08:00
2012-10-09 20:35:17 +08:00
**provides easy no-boilerplate testing**
2011-07-07 04:05:48 +08:00
2012-10-18 18:24:50 +08:00
- makes it :ref:`easy to get started <getstarted>`,
many :ref:`usage options <usage>`
2011-07-07 04:05:48 +08:00
- :ref:`assert with the assert statement`
- helpful :ref:`traceback and failing assertion reporting <tbreportdemo>`
- allows :ref:`print debugging <printdebugging>` and :ref:`the
capturing of standard output during test execution <captures>`
2012-10-09 20:35:17 +08:00
**scales from simple unit to complex functional testing**
2011-07-07 04:05:48 +08:00
2012-10-07 19:06:17 +08:00
- (new in 2.3) :ref:`modular parametrizeable fixtures <fixture>`
- :ref:`parametrized test functions <parametrized test functions>`
2012-10-18 18:24:50 +08:00
- :ref:`mark`
2012-10-09 20:35:17 +08:00
- :ref:`skipping`
2011-07-07 04:05:48 +08:00
- can :ref:`distribute tests to multiple CPUs <xdistcpu>` through :ref:`xdist plugin <xdist>`
- can :ref:`continuously re-run failing tests <looponfailing>`
2012-10-18 18:24:50 +08:00
- many :ref:`builtin helpers <pytest helpers>` and :ref:`plugins <plugins>`
2011-07-07 04:05:48 +08:00
- flexible :ref:`Python test discovery`
2012-10-09 20:35:17 +08:00
**integrates many common testing methods**:
2011-07-07 04:05:48 +08:00
2012-10-25 19:48:31 +08:00
- multi-paradigm: pytest can run many ``nose``, ``unittest.py`` and
``doctest.py`` style test suites, including running testcases made for
Django and trial
2012-10-09 20:35:17 +08:00
- supports :ref:`good integration practises <goodpractises>`
2011-07-07 04:05:48 +08:00
- supports extended :ref:`xUnit style setup <xunitsetup>`
- supports domain-specific :ref:`non-python tests`
- supports the generation of testing coverage reports
- `Javascript unit- and functional testing`_
2012-10-18 18:24:50 +08:00
- supports :pep:`8` compliant coding styles in tests
2011-07-07 04:05:48 +08:00
2012-10-09 20:35:17 +08:00
**extensive plugin and customization system**:
2011-07-07 04:05:48 +08:00
- all collection, reporting, running aspects are delegated to hook functions
- customizations can be per-directory, per-project or per PyPI released plugins
- it is easy to add command line options or do other kind of add-ons and customizations.
.. _`Javascript unit- and functional testing`: http://pypi.python.org/pypi/oejskit
.. _`easy`: http://bruynooghe.blogspot.com/2009/12/skipping-slow-test-by-default-in-pytest.html
2009-03-24 00:40:18 +08:00
2008-08-16 23:26:59 +08:00