Skip to content

Commit 5c566a5

Browse files
committed
Formulation details in the documentation.
1 parent 1ccafef commit 5c566a5

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

doc/src/advanced.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ Consider the following example test module:
1717
.. literalinclude:: ../examples/dyn-parametrized.py
1818

1919
In principle, this example works the very same way as the basic
20-
example for parametrized tests, see :ref:`usage-parametrized`. The
21-
only difference is that the lists of paramters are dynamically
22-
compiled beforehand. The test for child `l` deliberately fails, just
23-
to show the effect. As a consequence, the test for its parent `d`
24-
will be skipped.
20+
example for :ref:`usage-parametrized`. The only difference is that
21+
the lists of paramters are dynamically compiled beforehand. The test
22+
for child `l` deliberately fails, just to show the effect. As a
23+
consequence, the test for its parent `d` will be skipped.
24+
25+
.. _advanced-grouping-fixtures:
2526

2627
Grouping tests using fixtures
2728
-----------------------------

doc/src/usage.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ Naming tests
4444
Tests are referenced by their name in the `depends` argument. The
4545
default for this name is the node ID defined by pytest, that is the
4646
name of the test function, extended by the parameters if applicable.
47-
As these node IDs may become complicated, the name can be overridden
48-
by an explicit `name` argument to the marker. The following example
49-
works exactly as the last one, only the test names are explicitely
50-
set:
47+
In some cases, it's not easy to predict the names of the node IDs.
48+
For this reason, the name of the tests can be overridden by an
49+
explicit `name` argument to the marker. The following example works
50+
exactly as the last one, only the test names are explicitely set:
5151

5252
.. literalinclude:: ../examples/named.py
5353

@@ -100,3 +100,9 @@ Tests `test_c` and `test_d` set their dependencies at runtime calling
100100
of the `request` pytest fixture, the second argument is the list of
101101
dependencies. It has the same effect as passing this list as the
102102
`depends` argument to the :func:`pytest.mark.dependency` marker.
103+
104+
The present example is certainly somewhat artificial, as the use of
105+
the :func:`pytest_dependency.depends` function would not be needed in
106+
such a simple case. For a more involved example that can not as
107+
easily be formulated with the static the `depends` argument, see
108+
:ref:`advanced-grouping-fixtures`.

0 commit comments

Comments
 (0)