Thanks Imran.
I tried this copy.deepcopy() already and it fails with below error.
   "TypeError: cannot deepcopy this pattern object"

Is there any other way to do this?
Thanks,
Shiban.


On Wed, Apr 15, 2020 at 3:26 AM Imran M <iomum...@gmail.com> wrote:

> Sounds like you want a deep copy?
>
> https://docs.python.org/3.8/library/copy.html
>
> Not sure if there's a Pytest way of doing this.
>
> On Tue, Apr 14, 2020, 2:46 PM Anton Shiban <kantonshi...@gmail.com> wrote:
>
>> 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