File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,7 @@ Reference
12
12
13
13
:param name: the name of the test to be used for referencing by
14
14
dependent tests. If not set, it defaults to the node ID
15
- defined by pytest, that is the name of the test function,
16
- extended by the parameters if applicable. The name must be
17
- unique in the scope, which is currently the test module.
15
+ defined by pytest. The name must be unique.
18
16
:type name: :class: `str `
19
17
:param depends: dependencies, a list of names of tests that this
20
18
test depends on. The test will be skipped unless all of the
@@ -26,6 +24,10 @@ Reference
26
24
either `'session' `, `'package' `, `'module' `, or `'class' `.
27
25
:type scope: :class: `str `
28
26
27
+ See Section :ref: `names ` for details on the default name if the
28
+ `name ` argument is not set and on how references in the `depends `
29
+ argument must be adapted to the scope.
30
+
29
31
.. versionchanged :: 0.5.0
30
32
the scope parameter has been added.
31
33
Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ turn will be run and succeed. It depends on the test method `test_b`
53
53
of class `TestClass ` in `tests/test_mod_01.py `, not on the test
54
54
function of the same name.
55
55
56
+ The `scope ` argument only affects the references in the `depends `
57
+ argument of the marker. It does not matter which scope is set for the
58
+ dependencies: the dependency of `test_e ` in `tests/test_mod_02.py ` on
59
+ `test_a ` in `tests/test_mod_01.py ` is in session scope. It is not
60
+ needed to set the scope also for `test_a `.
61
+
56
62
Note that the references in session scope must use the full node id of
57
63
the dependencies. This node id is composed of the module path, the
58
64
name of the test class if applicable, and the name of the test,
You can’t perform that action at this time.
0 commit comments