in Python

PyCharm: Run All Unit Tests in a Folder/Package

My unit tests can be started individually from the context menu. I can also run all of them using something like

nosetests ./*

from within that specific folder containing the tests.

I played around a while with PyCharm to find a run configuration that actually allows me to runn all tests from all files within a folder at mouseclick.

Create a run configuration using Edit Configurations from the menu, add one with the ‘+’ sign and choose any python unittest that suits your needs from the list of options:

PyCharm Testrunner configuration

PyCharm Testrunner configuration

The tricky bit is the pattern. My test unit files all end in * – I played aroung ab bit, until the regex really worked:


I settled for the middle option, but all 3 work.

Print Friendly, PDF & Email



Time limit is exhausted. Please reload CAPTCHA.

  • Anderer Inhalt mit diesem Tag