Can you run unittests in parallel in pycharm?

Can you run unittests in parallel in Pycharm?

I have Pycharm 18.3.4 Professional

0
3 comments

Hi Steve

The default implementation of unittest doesn't support parallel testing, but you can work around it by:

1. Create multiple run configurations for each test and run them manually, each one will run as a separate python process.

2. You can actually run unittests using pytest, and pytest have xdist plugin which enables multiprocess execution:

https://docs.pytest.org/en/3.0.0/xdist.html

0

It would be a huge productivity increase to implement this. It just means handling the file-level discovery on the PyCharm side and multi-processing the run per file. I have something that does this in the shell already but I really like debugging unittests in PyCharm! Please? ;)

If you guys get around to this feature, I recommended also adding the ability to split the output per process since they will interleave if streamed to the same output.

3
Avatar
Permanently deleted user

What Rafesacks said ---- implementing file-discovery in PyCharm shouldn't be too much work and the benefit would be immense. It would make testing literally 20x faster for me on a tiny personal project, not to speak of those that use PyCharm for bigger projects.

1

Please sign in to leave a comment.