[pytest-dev] How to duplicate pytest.Item inside function 'pytest_collection_modifyitems'?

Florian Bruhin me at the-compiler.org
Wed Apr 15 03:37:48 EDT 2020


Hey,

On Wed, Apr 15, 2020 at 03:16:45AM +0530, Anton Shiban wrote:
> Can you please guide me *how to* *clone pytest.Item?*
> 
> I want to take one *item* from *items* array (inside function
> ‘pytest_collection_modifyitems’) and clone that *item* and add it to *items*
> array back.
> 
> Can someone please guide to do this?

I doubt that's possible - what's your goal? You might be able to use
pytest_generate_tests instead, see e.g. pytest-repeat:
https://github.com/pytest-dev/pytest-repeat/blob/master/pytest_repeat.py

Florian

-- 
me at the-compiler.org (Mail/XMPP) | https://www.qutebrowser.org 
       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
       GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
             I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20200415/da7bd800/attachment.sig>


More information about the pytest-dev mailing list