test_models.py not recognized as a python file


If i create a file named "test_models.py" its will not be recognized. It appears with the Plain Text icon and syntax highlight.

Anyone else with this problem?

Version: PyCharm 2016.2.1


Hi Stefan. Do you have tests in this file? 


Looks like bug. Please report this bug issue tracker https://youtrack.jetbrains.com/



I have the same issue in the most recent PyCharm version (2018.2).


I had this issue and resolved it as follows:

Settings->Editor->File Types->Text remove the offending file's name from the list.

I got into this situation when creating a new python file and accidentally creating it as a text file with a .py extension. It then gets added to the configured list of files to be recognized as text (and this is very well hidden if you did realize what you have done).


Please sign in to leave a comment.