summaryrefslogtreecommitdiff
path: root/doc/en/usage.rst
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2018-05-21 13:24:39 -0300
committerGitHub <noreply@github.com>2018-05-21 13:24:39 -0300
commit7d0c9837ce4c3411ad8b5d82ee2ce6b1eebeaf28 (patch)
tree4967c21ce012728d6504029bccec63990246ca6a /doc/en/usage.rst
parent4aa7ebaf52ce44760c99f16024c8be6ed8cdd001 (diff)
parente7f75f69f202a3f980263526d135b76094ad7129 (diff)
downloadpytest-7d0c9837ce4c3411ad8b5d82ee2ce6b1eebeaf28.tar.gz
Merge pull request #3459 from RonnyPfannschmidt/mark-iter-name-filter
introduce name filtering for marker iteration again
Diffstat (limited to 'doc/en/usage.rst')
-rw-r--r--doc/en/usage.rst7
1 files changed, 3 insertions, 4 deletions
diff --git a/doc/en/usage.rst b/doc/en/usage.rst
index b9b8059f7..667eaf8ee 100644
--- a/doc/en/usage.rst
+++ b/doc/en/usage.rst
@@ -274,10 +274,9 @@ Alternatively, you can integrate this functionality with custom markers:
def pytest_collection_modifyitems(session, config, items):
for item in items:
- for marker in item.iter_markers():
- if marker.name == 'test_id':
- test_id = marker.args[0]
- item.user_properties.append(('test_id', test_id))
+ for marker in item.iter_markers(name='test_id'):
+ test_id = marker.args[0]
+ item.user_properties.append(('test_id', test_id))
And in your tests: