pycharmpytestconftest

IDE doesn't recognize conftest.py as a python file


I have a python project with tests and a conftest file, and a few days ago - out of nowhere - Pycharm decided that it's not a python script:

enter image description here

The result is that I can't debug it, can't jump to source, don't have inspection and ext'.

Moreover - If I change the name to something different, all of the sudden it's a python script again:

enter image description here

Why is this happening? Can anyone tell? I searched the settings for mentions of conftest and found nothing. How do I fix this?


Solution

  • conftest.py has a wrong file type assigned to it, check Settings | Editor | File Types | Text and remove conftest.py from "File Name Patterns".

    enter image description here