Pycharm執行.py檔案,控制檯多了很多無用資訊,是命名問題
阿新 • • 發佈:2019-01-02
C:\Python35\python3.exe "E:\Program Files\JetBrains\PyCharm 2017.1.1\helpers\pycharm\_jb_unittest_runner.py" --path F:/PythonCode/kaoshi/test.py
Testing started at 20:13 ...
Launching unittests with arguments python -m unittest discover -s F:/PythonCode/kaoshi -p test.py -t F:\PythonCode\kaoshi in F:\PythonCode\kaoshi
123456
Ran 0 tests in 0.000s
OK
Process finished with exit code 0
Testing started at 20:13 ...
Launching unittests with arguments python -m unittest discover -s F:/PythonCode/kaoshi -p test.py -t F:\PythonCode\kaoshi in F:\PythonCode\kaoshi
123456
Ran 0 tests in 0.000s
OK
Process finished with exit code 0
Empty test suite.
在pycharm中檔名不能命名為test,函式名也不能命名為test,這是因為test在python函式庫中是關鍵字,起了衝突
出現控制檯問題後:
正確的是沒有Unittests in test.py
python中有很多關鍵字,出現這樣的輸出一般為關鍵字衝突,試著修改函式名或者檔名