File: mark.txt

package info (click to toggle)
pytest 2.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,564 kB
  • sloc: python: 16,243; makefile: 162; sh: 68
file content (35 lines) | stat: -rw-r--r-- 933 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

.. _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: