I am having 3 test classes in a single file.
Each Class has its own setup and teardown methods. I want to make config in pytest where I can parallelize the run of 3 test classes in separately in 3 threads. How do I achieve this?
Please help.
Install xdist plugin and use -n=count_of_threads. If the tests have to be run in parallel then we can use --dist=loadscope to group all the tests in the same test class.
--dist=loadscope: tests will be grouped by the module for test functions and by class for test methods, then each group will be sent to an available worker.

pytest filename -n=thread_count --dist=loadscope
Running Parallel tests Class wise in pytest