It took a whole day to finally solve this bug (python: Empty suite)!

Next, I will explain to you:

Empty test suite.(Solution to PyCharm program running error)

Find the reason:

By default, PyCharm will check the files beginning with test, which are subclasses of unittest.TestCase, but you can control the mode and subclass options.

Solution:

1. Change the name of the program, do not start with test
. 2. The default test runner must be set to Nosetests in the File> Settings> Tools> Python Integrated Tools dialog box. However, if you have already tried to use a non-Nosetests runner (e.g. Unittests seems to be the default), you must first delete the existing configuration. To do this, go to Run->Edit Configurations and you will see under "Python Tests" it says "Unit Test in test_your_filename". Click it, and then click the red "-" button at the top of the box to delete. Double check the settings of the test run configuration:

Menu【Run】–【Edit Configurations...】

That's it for sharing. If you have any questions, leave a message in the comment area, discuss with each other and solve them together! ! !

Guess you like

Origin blog.csdn.net/xieminglu/article/details/109304738