Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make unit test in pyCharm

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

like image 601
Ramzi Khahil Avatar asked Jun 03 '12 11:06

Ramzi Khahil


1 Answers

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.

like image 131
CrazyCoder Avatar answered Oct 16 '22 18:10

CrazyCoder