使用python时,出现了以下错误:
C:\Anaconda3\python.exe "E:\ProgramList\PYCHARM\PyCharm 2016.2.3\PyCharm 2016.3.1\helpers\pycharm\_jb_nosetest_runner.py" --target decorator_class_func.py::test_deco Testing started at 17:54 ... Launching Nosetest with arguments E:\ProgramList\PYCHARM\PyCharm 2016.2.3\PyCharm 2016.3.1\helpers\pycharm\_jb_nosetest_runner.py decorator_class_func.py:test_deco in E:\ProgramList\PYCHARM\CorePython ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK Process finished with exit code 0 Empty test suite.
查找到stackoverflow上的一个回答:
The problem is that PyCharm doesn’t apply the given search pattern for test files (-p “*_tests.py”). It’s a bug that has already been reported: https://youtrack.jetbrains.com/issue/PY-15869
The solution has been to simply rename my files 😛
原先代码中有个类名中含有“test”字样,把test删了以后可以正常运行。
特此记录