pytest2/doc/features.txt

65 lines
2.5 KiB
Plaintext

py.test Features
==================
mature no-boilerplate testing with Python
------------------------------------------------
- automatic, customizable :ref:`Python test discovery`
- simple test functions and freely groupable tests
- simple ``assert`` statements for assertions
- powerful parametrization of test functions
- very helpful traceback and failing assertion reporting
- use ``print`` or ``pdb`` debugging on failures
- enables fully :pep:`8` compliant coding style
- powerful :ref:`usage` possibilities, well sorted command line options
- used in many projects, ranging from 10 to 10K tests
- tested on Unix and Windows from Python 2.4 up to Python 3.1 and 3.2
- keyword/testname based selection of tests
supports common testing practises and methods
-----------------------------------------------------------
- can integrate ``nose``, ``unittest.py`` and ``doctest.py`` style
tests, including running testcases made for Django and trial
- supports extended `xUnit style setup`_
- supports domain-specific :ref:`non-python tests`
- supports generating testing coverage reports
- `Javasript unit- and functional testing`_
.. _`Javasript unit- and functional testing`: http://pypi.python.org/pypi/oejskit
distributing tests to local/remote subprocesses
--------------------------------------------------------
- can distribute tests to multiple CPUs
- can distribute tests to remote ssh or socket connected machines
- can run tests in subprocess, re-run failing ones on file-change
extensive plugin and customization system
------------------------------------------------------
.. _`easy`: http://bruynooghe.blogspot.com/2009/12/skipping-slow-test-by-default-in-pytest.html
- all collection, reporting, running aspects are delegated to hook functions
- hook functions are implemented per-directory, per-project or through PyPI released plugins
- it is `easy`_ to add command line options or
do other kind of add-ons and customizations.
integrates well with CI systems
----------------------------------------
- produces compatible JunitXML output for Hudson or other CI servers
- produces "resultlog" text files for easy parsing
- integrates well with tox_
.. _`tox`: http://codespeak.net/tox
skip or expect-to-fail a test
-------------------------------------------
- skip tests if there are platform or dependency mismatches
- xfail a test (on certain platforms)indicating an implementation problem
- you can use skip and xfail imperatively or as a decorating marker
.. include:: links.inc