Merge pull request #2763 from jhamman/docs/skipif_class_warning

add warning to skipping docs re marker inheritance
This commit is contained in:
Bruno Oliveira 2017-09-09 15:15:47 -03:00 committed by GitHub
commit 3c1ca03b9c
1 changed files with 11 additions and 7 deletions

View File

@ -118,6 +118,12 @@ You can use the ``skipif`` marker (as any other marker) on classes::
If the condition is ``True``, this marker will produce a skip result for If the condition is ``True``, this marker will produce a skip result for
each of the test methods of that class. each of the test methods of that class.
.. warning::
The use of ``skipif`` on classes that use inheritance is strongly
discouraged. `A Known bug <https://github.com/pytest-dev/pytest/issues/568>`_
in pytest's markers may cause unexpected behavior in super classes.
If you want to skip all test functions of a module, you may use If you want to skip all test functions of a module, you may use
the ``pytestmark`` name on the global level: the ``pytestmark`` name on the global level:
@ -346,5 +352,3 @@ test instances when using parametrize:
]) ])
def test_increment(n, expected): def test_increment(n, expected):
assert n + 1 == expected assert n + 1 == expected