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

前端 未结 6 1495
猫巷女王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:15

    As to me, "If you right-click inside the 'if name == "main"' block" will not work.

    For example if you want to run "dlib_fun_test.py", you should ‘Edit Configurations’ , remove it from "python tests", and then add it to the above "Python".

    The below is my configure:

    Or you can also run the script, in bash console by python just_test.py.

提交回复
热议问题