*copey with the correct mail*

Hi Shiban,

its not safely possible to clone a item in general.

A) you need to make a new nodeid to prevent some issues

B) there is no safe cloning mechanism declared, different subtypes of items have different mutable state you dont want to mix

I believe the closest you can get is creating a new item that is reasonably equivalent.
The Details of that would depend on what the actual Item subtype is.

-- Ronny

Am 15.04.20 um 07:45 schrieb Ronny Pfannschmidt:

Hi Shiban,

its not safely possible to clone a item in general.

A) you need to make a new nodeid to prevent some issues

B) there is no safe cloning mechanism declared, different subtypes of items have different mutable state you dont want to mix

I believe the closest you can get is creating a new item that is reasonably equivalent.
The Details of that would depend on what the actual Item subtype is.

-- Ronny

Am 14.04.20 um 23:46 schrieb Anton Shiban:

Hi,


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?


Thanks,

Shiban.


_______________________________________________
pytest-dev mailing list
pytest-dev@python.org
https://mail.python.org/mailman/listinfo/pytest-dev
_______________________________________________
pytest-dev mailing list
pytest-dev@python.org
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to