Pycharm won't allow to run a file. Shows run unittest option only.

前端 未结 6 1472
猫巷女王i
猫巷女王i 2020-12-28 12:41

I have a file and it has bunch of methods starting with prefix \"test\". Now I want to run this file and it has a __name__ == \"__main__\" construct which sets

6条回答
  •  独厮守ぢ
    2020-12-28 13:12

    If you right-click inside the 'if name == "main"' block, it will show you the regular "Run script" option instead of "Run unit test". After that, you can save the created run configuration and use it to run the script.

提交回复
热议问题