[Answered ]-Pytest and playwright – multiple browsers when using class-scoped fixtures

1👍

You’re attempting to mix pytest fixtures with classes that inherit unittest.TestCase. But that can’t be done directly. See https://stackoverflow.com/a/18187731/7058266 for details.

However, there are workarounds. For example, in https://stackoverflow.com/a/52062473/7058266 you see a way of using the parameterized Python library (https://pypi.org/project/parameterized/) for accomplishing the same goal. That’s probably how you want to open multiple browsers. Combine that with pytest-xdist so that you can run multiple pytest tests at the same time with pytest -n NUM_PROCESSES.

Leave a comment