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

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

    I had the same problem, deleted my .idea folder in the directory of the project I was working on and was able to run my tests normally again:

    PyCharm 2018.2.4 (Community Edition)
    Build #PC-182.4505.26, built on September 19, 2018
    JRE: 1.8.0_152-release-1248-b8 amd64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    Windows 10 10.0
    

    P.S. You can your version of PyCharm by going to Help -> About

提交回复
热议问题