How to make unit test in pyCharm

13,917

You need to double check the settings for the tests run configuration:

settings

By default PyCharm will inspect files that start with test and that are subclasses of unittest.TestCase, however you can control the Pattern and the subclasses option.

Change Pattern according to your test file names, it accepts Python regular expression.

Share:
13,917
Ramzi Khahil
Author by

Ramzi Khahil

My general StackExchange profile Xing:

Updated on June 05, 2022

Comments

  • Ramzi Khahil
    Ramzi Khahil about 2 years

    I want to make some unit tests, so I set up a list with values that all should be asserted true, just like this question. But I want it to run in PyCharm (With pressing Alt+Shift+F10)

    If I just use the code from the answers, I just get No tests were found

  • fatuhoku
    fatuhoku almost 11 years
    That's not true. PyCharm supports py.test which does not require any test classes to extend unittest.TestCase (py.test promises no APIs)
  • swdev
    swdev over 10 years
    That filename started with "test*" pattern were really helped me. And it is case sensitive...