Skip to content

Commit c9768a0

Browse files
committed
Add a note that test names must be unique.
1 parent b02c23f commit c9768a0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

doc/src/reference.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Reference
1313
:param name: the name of the test to be used for referencing by
1414
dependent tests. If not set, it defaults to the node ID
1515
defined by pytest, that is the name of the test function,
16-
extended by the parameters if applicable.
16+
extended by the parameters if applicable. The name must be
17+
unique in the scope, which is currently the test module.
1718
:type name: :class:`str`
1819
:param depends: dependencies, a list of names of tests that this
1920
test depends on. The test will be skipped unless all of the

doc/src/usage.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ 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.
4747
In some cases, it's not easy to predict the names of the node IDs.
4848
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:
49+
explicit `name` argument to the marker. The names must be unique in
50+
the scope, which is currently the test module. The following example
51+
works exactly as the last one, only the test names are explicitely
52+
set:
5153

5254
.. literalinclude:: ../examples/named.py
5355

0 commit comments

Comments
 (0)