hrcorval / behavex

BDD testing solution designed to enhance your Behave-based testing workflows
https://github.com/hrcorval/behavex
MIT License
89 stars 20 forks source link

[Help Needed] Not able to execute before_all and after_all method only once #178

Open prashant1507 opened 2 weeks ago

prashant1507 commented 2 weeks ago

Description I'm running my tests in parallel using 4 processes - scenario by scenario.

Now I want to do some tasks in before_all and after_all but only 1 time, meaning do X in before_all only 1 time and use X in after_all only 1 time

What I tried I tried to use context.config.userdata['worker_id'], current_process(), parent_process() in order to identify but instances are totally differet.

Please suggest me some solution or a workaround which I can try to achieve it

Thanks

iamkenos commented 1 week ago

Hi! A couple workarounds I can think of (depending on what it is you wanna do):

watching the issue to keep an eye out for other inputs!

prashant1507 commented 1 week ago

I tried second approach but it fails because of race condition specially in after_all

( Yes I need context in both after_all and before _all)