pytest-dev / pytest-repeat

pytest plugin for repeating test execution
https://pypi.python.org/pypi/pytest-repeat/
Other
169 stars 27 forks source link

How do I get the current number of repetitions in the setup_class function #58

Closed panyicheng123 closed 11 months ago

panyicheng123 commented 1 year ago

I want to use an environment based on the number of repetitions as the picture show image

panyicheng123 commented 1 year ago

Thanks everyone who can reply to me

RonnyPfannschmidt commented 1 year ago

its not clear why you do not use parametrize of the keys instead, as that gives you the key and correctly works on any case

its not safely possible to get the functon scope repeat value at the class level

th fact that ou absolutely need the environment extracted and the number of repeats match the key means that you dont want a repeat, you want a parametrize with class scope

panyicheng123 commented 1 year ago

its not clear why you do not use parametrize of the keys instead, as that gives you the key and correctly works on any case

its not safely possible to get the functon scope repeat value at the class level

th fact that ou absolutely need the environment extracted and the number of repeats match the key means that you dont want a repeat, you want a parametrize with class scope

thanks for your reply,i will try it.

okken commented 11 months ago

looks like this was resolved as not needed