Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > 85556a06d0b40546e6bb4676359ced2e > files > 132

python-pytest-2.2.4-1mdv2010.1.noarch.rpm


.. _mark:

Marking test functions with attributes
=================================================================

.. currentmodule:: _pytest.mark

By using the ``pytest.mark`` helper you can easily set
metadata on your test functions. There are
some builtin markers, for example:

* :ref:`skipif <skipif>` - skip a test function if a certain condition is met
* :ref:`xfail <xfail>` - produce an "expected failure" outcome if a certain
  condition is met
* :ref:`parametrize <parametrizemark>` to perform multiple calls
  to the same test function.

It's easy to create custom markers or to apply markers
to whole test classes or modules. See :ref:`mark examples` for examples
which also serve as documentation.


API reference for mark related objects
------------------------------------------------

.. autoclass:: MarkGenerator
    :members:

.. autoclass:: MarkDecorator
    :members:

.. autoclass:: MarkInfo
    :members: