diff options
author | Bruno Oliveira <nicoddemus@gmail.com> | 2018-05-21 13:24:39 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-21 13:24:39 -0300 |
commit | 7d0c9837ce4c3411ad8b5d82ee2ce6b1eebeaf28 (patch) | |
tree | 4967c21ce012728d6504029bccec63990246ca6a /doc/en/usage.rst | |
parent | 4aa7ebaf52ce44760c99f16024c8be6ed8cdd001 (diff) | |
parent | e7f75f69f202a3f980263526d135b76094ad7129 (diff) | |
download | pytest-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.rst | 7 |
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: |