学习Pycharm时在testing-your-first-python-application遇到了no tests were found的一种解决办法
问题描述:参照Pycharm提供的教程,学习下如何测试工程,但当把Pycharm网站(Step 3. Test your first Python application | PyCharm (jetbrains.com))里提供的代码复制到自己建立的文件中,再点击运行,Pycharm IDE中的RUN窗口会提示“NO tests were found”.解决方案:在文档最后增加两行代码即可,如下:if __name__ == '__main__': unittest.main()解决