summaryrefslogtreecommitdiff
path: root/doc/en/skipping.rst
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2018-06-02 20:29:28 -0700
committerAnthony Sottile <asottile@umich.edu>2018-06-03 07:58:46 -0700
commit0f2d7dc73cb94b141cc49f452b6f10f7a2d1d5cf (patch)
tree5e59994f200e74da40c0957c1dedbbba9304bcf4 /doc/en/skipping.rst
parent5c878001eaaf55859c0ae0f0d32b067415592b87 (diff)
downloadpytest-0f2d7dc73cb94b141cc49f452b6f10f7a2d1d5cf.tar.gz
blacken docs
Diffstat (limited to 'doc/en/skipping.rst')
-rw-r--r--doc/en/skipping.rst30
1 files changed, 18 insertions, 12 deletions
diff --git a/doc/en/skipping.rst b/doc/en/skipping.rst
index 1edc03401..bfa6f3e75 100644
--- a/doc/en/skipping.rst
+++ b/doc/en/skipping.rst
@@ -192,19 +192,19 @@ Here's a quick guide on how to skip tests in a module in different situations:
.. code-block:: python
- pytestmark = pytest.mark.skip('all tests still WIP')
+ pytestmark = pytest.mark.skip("all tests still WIP")
2. Skip all tests in a module based on some condition:
.. code-block:: python
- pytestmark = pytest.mark.skipif(sys.platform == 'win32', 'tests for linux only')
+ pytestmark = pytest.mark.skipif(sys.platform == "win32", "tests for linux only")
3. Skip all tests in a module if some import is missing:
.. code-block:: python
- pexpect = pytest.importorskip('pexpect')
+ pexpect = pytest.importorskip("pexpect")
.. _xfail:
@@ -364,14 +364,20 @@ test instances when using parametrize:
import pytest
- @pytest.mark.parametrize(("n", "expected"), [
- (1, 2),
- pytest.param(1, 0, marks=pytest.mark.xfail),
- pytest.param(1, 3, marks=pytest.mark.xfail(reason="some bug")),
- (2, 3),
- (3, 4),
- (4, 5),
- pytest.param(10, 11, marks=pytest.mark.skipif(sys.version_info >= (3, 0), reason="py2k")),
- ])
+
+ @pytest.mark.parametrize(
+ ("n", "expected"),
+ [
+ (1, 2),
+ pytest.param(1, 0, marks=pytest.mark.xfail),
+ pytest.param(1, 3, marks=pytest.mark.xfail(reason="some bug")),
+ (2, 3),
+ (3, 4),
+ (4, 5),
+ pytest.param(
+ 10, 11, marks=pytest.mark.skipif(sys.version_info >= (3, 0), reason="py2k")
+ ),
+ ],
+ )
def test_increment(n, expected):
assert n + 1 == expected