[pytest-dev] Parametrized tests funcargs missing on 'pytest_collection_modifyitems' hook (pytest 2.5.2)

Anton P anton7811 at gmail.com
Wed Feb 26 12:19:54 CET 2014


Hi,

 For testing purposes I use hook 'pytest_collection_modifyitems' to get
values of all arguments passed in parametrized test function, e.g.:

*def pytest_collection_modifyitems(items):*
*    for item in items:*
*        print item.funcargs*

with code execution example:

*{'doc': ['doc_1'], 'name': 'test_1'}*
*{'doc': ['doc_2'], 'name': 'test_2'}*
*{'doc': ['doc_3'], 'name': 'test_3'}*

 Example of code usage is attached. It works fine with pytest version 2.4.2.
 However while moving to pytest version 2.5.2 i faced the following issue:
*item.funcargs *dictionary is empty
{}
{}
{}

 Could you please clarify how can I get *funcargs *in the
'pytest_collection_modifyitems' hook in pytest 2.5.2?

Thanks in advance!
Anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20140226/bf8fd6a5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conftest.py
Type: text/x-python
Size: 129 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20140226/bf8fd6a5/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_marks.py
Type: text/x-python
Size: 259 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20140226/bf8fd6a5/attachment-0001.py>


More information about the Pytest-dev mailing list