How to make unit test in pyCharm
13,917
You need to double check the settings for the tests run configuration:
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.
![Ramzi Khahil](https://i.stack.imgur.com/BHSVU.jpg?s=256&g=1)
Comments
-
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 pressingAlt
+Shift
+F10
)If I just use the code from the answers, I just get
No tests were found
-
fatuhoku almost 11 yearsThat's not true. PyCharm supports
py.test
which does not require any test classes to extendunittest.TestCase
(py.test
promises no APIs) -
swdev over 10 yearsThat filename started with "test*" pattern were really helped me. And it is case sensitive...